forked from pion/webrtc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
icemux.go
30 lines (25 loc) · 854 Bytes
/
icemux.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
// SPDX-License-Identifier: MIT
package webrtc
import (
"net"
"github.com/pion/ice/v2"
"github.com/pion/logging"
)
// NewICETCPMux creates a new instance of ice.TCPMuxDefault. It enables use of
// passive ICE TCP candidates.
func NewICETCPMux(logger logging.LeveledLogger, listener net.Listener, readBufferSize int) ice.TCPMux {
return ice.NewTCPMuxDefault(ice.TCPMuxParams{
Listener: listener,
Logger: logger,
ReadBufferSize: readBufferSize,
})
}
// NewICEUDPMux creates a new instance of ice.UDPMuxDefault. It allows many PeerConnections to be served
// by a single UDP Port.
func NewICEUDPMux(logger logging.LeveledLogger, udpConn net.PacketConn) ice.UDPMux {
return ice.NewUDPMuxDefault(ice.UDPMuxParams{
UDPConn: udpConn,
Logger: logger,
})
}