mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-06-19 12:11:22 +00:00
fix: add timeout for incoming connections and build-in protocols (#1292)
Ensure that we don't wait forever for upgrading an inbound connection to occur. Note that transports should return an AbortableSource when passed an AbortSignal so outbound connections to not need the same fix. Also adds default timeouts for the ping, fetch, and identify protocols.
This commit is contained in:
@ -54,7 +54,8 @@ describe('Connection Manager', () => {
|
||||
const connectionManager = new DefaultConnectionManager({
|
||||
maxConnections: 1000,
|
||||
minConnections: 50,
|
||||
autoDialInterval: 1000
|
||||
autoDialInterval: 1000,
|
||||
inboundUpgradeTimeout: 1000
|
||||
})
|
||||
connectionManager.init(new Components({ upgrader, peerStore }))
|
||||
|
||||
@ -89,7 +90,8 @@ describe('Connection Manager', () => {
|
||||
const connectionManager = new DefaultConnectionManager({
|
||||
maxConnections: 1000,
|
||||
minConnections: 50,
|
||||
autoDialInterval: 1000
|
||||
autoDialInterval: 1000,
|
||||
inboundUpgradeTimeout: 1000
|
||||
})
|
||||
connectionManager.init(new Components({ upgrader, peerStore }))
|
||||
|
||||
|
Reference in New Issue
Block a user