From ca3f4e8701a9d860796d808f92084ce5b154de79 Mon Sep 17 00:00:00 2001 From: Tanguy Date: Wed, 25 May 2022 17:59:42 +0200 Subject: [PATCH] builder: Expose MaxChanCount (#722) --- libp2p/builders.nim | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libp2p/builders.nim b/libp2p/builders.nim index e0ca64d72..d77031b15 100644 --- a/libp2p/builders.nim +++ b/libp2p/builders.nim @@ -86,12 +86,17 @@ proc withSignedPeerRecord*(b: SwitchBuilder, sendIt = true): SwitchBuilder = b.sendSignedPeerRecord = sendIt b -proc withMplex*(b: SwitchBuilder, inTimeout = 5.minutes, outTimeout = 5.minutes): SwitchBuilder = +proc withMplex*( + b: SwitchBuilder, + inTimeout = 5.minutes, + outTimeout = 5.minutes, + maxChannCount = 200): SwitchBuilder = proc newMuxer(conn: Connection): Muxer = Mplex.new( conn, - inTimeout = inTimeout, - outTimeout = outTimeout) + inTimeout, + outTimeout, + maxChannCount) b.mplexOpts = MplexOpts( enable: true,