You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As preparation for tackling TCP support TURN protocol (#1), TURN client implementation needs to be able to take net.Conn in addition to net.PacketConn.
Current TURN Client design assumes that an instance of Client is created per socket (net.PacketConn). See Pion: TURN Client Refactor.
ClientConfig takes a parameter, net.PacketConn only, which needs to be changed.
Proposed change is to introduce an interface, turn.Conn which wraps both net.PacketConn and net.Conn.
// Conn a network connection interface with TURN server.typeConninterface {
LocalAddr() net.Addr// used to determine transport type and IP version
}
Justification: to prevent a user from trying to pass both net.PacketConn and net.Conn. (Client can only handle one underlying socket).
Above code won't work due to "duplicate method". We need to manually define methods.
Inside NetClient(), use type-switch to determine which transport protocol the app wants to use.
The text was updated successfully, but these errors were encountered:
Summary
As preparation for tackling TCP support TURN protocol (#1), TURN client implementation needs to be able to take net.Conn in addition to net.PacketConn.
Motivation
See #1.
Proposal
Current TURN Client design assumes that an instance of Client is created per socket (net.PacketConn). See Pion: TURN Client Refactor.
ClientConfig takes a parameter, net.PacketConn only, which needs to be changed.
Proposed change is to introduce an interface, turn.Conn which wraps both net.PacketConn and net.Conn.
Inside NetClient(), use type-switch to determine which transport protocol the app wants to use.
The text was updated successfully, but these errors were encountered: