Skip to content

Commit

Permalink
webrtc: clarify that there is no reuseport functionality (#2652)
Browse files Browse the repository at this point in the history
Co-authored-by: Marten Seemann <[email protected]>
  • Loading branch information
sukunrt and marten-seemann authored Dec 2, 2023
1 parent 7e18493 commit 97b4ca0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions p2p/transport/webrtc/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ func (t *WebRTCTransport) CanDial(addr ma.Multiaddr) bool {
return dialMatcher.Matches(addr)
}

// Listen returns a listener for addr.
//
// The IP, Port combination for addr must be exclusive to this listener as a WebRTC listener cannot
// be multiplexed on the same port as other UDP based transports like QUIC and WebTransport.
// See https://github.com/libp2p/go-libp2p/issues/2446 for details.
func (t *WebRTCTransport) Listen(addr ma.Multiaddr) (tpt.Listener, error) {
addr, wrtcComponent := ma.SplitLast(addr)
isWebrtc := wrtcComponent.Equal(webrtcComponent)
Expand Down

0 comments on commit 97b4ca0

Please sign in to comment.