Browse Source

webrtc: clarify that there is no reuseport functionality (#2652)

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
pull/2661/head
Sukun 11 months ago
committed by GitHub
parent
commit
97b4ca0fc8
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      p2p/transport/webrtc/transport.go

5
p2p/transport/webrtc/transport.go

@ -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)

Loading…
Cancel
Save