fix: Increase number of inbound and outbound streams to 1024 (#280)

This commit is contained in:
Dima
2023-03-03 17:59:17 +07:00
committed by GitHub
parent 9ed1e2eafc
commit 1ccc483532

View File

@ -135,6 +135,12 @@ export class RelayConnection extends FluenceConnection {
async connect(onIncomingParticle: ParticleHandler) { async connect(onIncomingParticle: ParticleHandler) {
await this._lib2p2Peer.start(); await this._lib2p2Peer.start();
// TODO: make it configurable
const handleOptions = {
maxInboundStreams: 1024,
maxOutboundStreams: 1024
}
this._lib2p2Peer.handle([PROTOCOL_NAME], async ({ connection, stream }) => { this._lib2p2Peer.handle([PROTOCOL_NAME], async ({ connection, stream }) => {
pipe( pipe(
stream.source, stream.source,
@ -156,7 +162,7 @@ export class RelayConnection extends FluenceConnection {
} }
}, },
); );
}); }, handleOptions);
log.debug(`dialing to the node with client's address: ` + this._lib2p2Peer.peerId.toString()); log.debug(`dialing to the node with client's address: ` + this._lib2p2Peer.peerId.toString());