From fd471facbf061576410e5136a7d0e6455bd5a343 Mon Sep 17 00:00:00 2001 From: sukun Date: Sun, 15 Oct 2023 19:35:54 +0530 Subject: [PATCH] webrtcprivate: set receive MTU size --- p2p/transport/webrtcprivate/transport.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/p2p/transport/webrtcprivate/transport.go b/p2p/transport/webrtcprivate/transport.go index 6bc27ca13b..1bb86439fa 100644 --- a/p2p/transport/webrtcprivate/transport.go +++ b/p2p/transport/webrtcprivate/transport.go @@ -34,6 +34,7 @@ import ( const ( name = "webrtcprivate" maxMsgSize = 4096 + receiveMTU = 1500 connectTimeout = time.Minute SignalingProtocol = "/webrtc-signaling" disconnectedTimeout = 20 * time.Second @@ -458,6 +459,7 @@ func (t *transport) NewPeerConnection() (*webrtc.PeerConnection, error) { s.SetICETimeouts(disconnectedTimeout, failedTimeout, keepaliveTimeout) s.DetachDataChannels() s.SetIncludeLoopbackCandidate(true) + s.SetReceiveMTU(receiveMTU) api := webrtc.NewAPI(webrtc.WithSettingEngine(s)) return api.NewPeerConnection(t.webrtcConfig) }