libp2p 2.8.9 → 2.8.10-7eed3b40d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.min.js +16 -16
- package/dist/index.min.js.map +4 -4
- package/dist/src/address-manager/index.d.ts.map +1 -1
- package/dist/src/address-manager/index.js +2 -5
- package/dist/src/address-manager/index.js.map +1 -1
- package/dist/src/connection-manager/connection-pruner.d.ts +0 -2
- package/dist/src/connection-manager/connection-pruner.d.ts.map +1 -1
- package/dist/src/connection-manager/connection-pruner.js +4 -10
- package/dist/src/connection-manager/connection-pruner.js.map +1 -1
- package/dist/src/connection-manager/dial-queue.d.ts.map +1 -1
- package/dist/src/connection-manager/dial-queue.js +2 -6
- package/dist/src/connection-manager/dial-queue.js.map +1 -1
- package/dist/src/connection-manager/index.d.ts +2 -1
- package/dist/src/connection-manager/index.d.ts.map +1 -1
- package/dist/src/connection-manager/index.js +13 -1
- package/dist/src/connection-manager/index.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.d.ts.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/package.json +11 -11
- package/src/address-manager/index.ts +2 -6
- package/src/connection-manager/connection-pruner.ts +4 -12
- package/src/connection-manager/dial-queue.ts +2 -7
- package/src/connection-manager/index.ts +19 -2
- package/src/version.ts +1 -1
- package/dist/typedoc-urls.json +0 -21
|
@@ -206,7 +206,7 @@ export class DefaultConnectionManager implements ConnectionManager, Startable {
|
|
|
206
206
|
private readonly maxIncomingPendingConnections: number
|
|
207
207
|
private incomingPendingConnections: number
|
|
208
208
|
private outboundPendingConnections: number
|
|
209
|
-
private
|
|
209
|
+
private maxConnections: number
|
|
210
210
|
|
|
211
211
|
public readonly dialQueue: DialQueue
|
|
212
212
|
public readonly reconnectQueue: ReconnectQueue
|
|
@@ -261,7 +261,6 @@ export class DefaultConnectionManager implements ConnectionManager, Startable {
|
|
|
261
261
|
events: components.events,
|
|
262
262
|
logger: components.logger
|
|
263
263
|
}, {
|
|
264
|
-
maxConnections: this.maxConnections,
|
|
265
264
|
allow: init.allow?.map(a => multiaddr(a))
|
|
266
265
|
})
|
|
267
266
|
|
|
@@ -424,6 +423,24 @@ export class DefaultConnectionManager implements ConnectionManager, Startable {
|
|
|
424
423
|
return this.maxConnections
|
|
425
424
|
}
|
|
426
425
|
|
|
426
|
+
setMaxConnections (maxConnections: number): void {
|
|
427
|
+
if (this.maxConnections < 1) {
|
|
428
|
+
throw new InvalidParametersError('Connection Manager maxConnections must be greater than 0')
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
let needsPrune = false
|
|
432
|
+
|
|
433
|
+
if (maxConnections < this.maxConnections) {
|
|
434
|
+
needsPrune = true
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
this.maxConnections = maxConnections
|
|
438
|
+
|
|
439
|
+
if (needsPrune) {
|
|
440
|
+
this.connectionPruner.maybePruneConnections()
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
|
|
427
444
|
onConnect (evt: CustomEvent<Connection>): void {
|
|
428
445
|
void this._onConnect(evt).catch(err => {
|
|
429
446
|
this.log.error(err)
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '2.8.
|
|
1
|
+
export const version = '2.8.10-7eed3b40d'
|
|
2
2
|
export const name = 'js-libp2p'
|
package/dist/typedoc-urls.json
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"AddressFilter": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.AddressFilter.html",
|
|
3
|
-
"AddressManagerInit": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.AddressManagerInit.html",
|
|
4
|
-
"ConnectionManagerInit": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.ConnectionManagerInit.html",
|
|
5
|
-
"ConnectionMonitorInit": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.ConnectionMonitorInit.html",
|
|
6
|
-
"Libp2pInit": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.Libp2pInit.html",
|
|
7
|
-
".:Libp2pInit": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.Libp2pInit.html",
|
|
8
|
-
"TransportManagerInit": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.TransportManagerInit.html",
|
|
9
|
-
"Libp2pOptions": "https://libp2p.github.io/js-libp2p/types/libp2p.index.Libp2pOptions.html",
|
|
10
|
-
".:Libp2pOptions": "https://libp2p.github.io/js-libp2p/types/libp2p.index.Libp2pOptions.html",
|
|
11
|
-
"ServiceFactoryMap": "https://libp2p.github.io/js-libp2p/types/libp2p.index.ServiceFactoryMap.html",
|
|
12
|
-
".:ServiceFactoryMap": "https://libp2p.github.io/js-libp2p/types/libp2p.index.ServiceFactoryMap.html",
|
|
13
|
-
"createLibp2p": "https://libp2p.github.io/js-libp2p/functions/libp2p.index.createLibp2p.html",
|
|
14
|
-
".:createLibp2p": "https://libp2p.github.io/js-libp2p/functions/libp2p.index.createLibp2p.html",
|
|
15
|
-
"userAgent": "https://libp2p.github.io/js-libp2p/functions/libp2p.user-agent.userAgent.html",
|
|
16
|
-
"./user-agent:userAgent": "https://libp2p.github.io/js-libp2p/functions/libp2p.user-agent.userAgent.html",
|
|
17
|
-
"name": "https://libp2p.github.io/js-libp2p/variables/libp2p.version.name.html",
|
|
18
|
-
"./version:name": "https://libp2p.github.io/js-libp2p/variables/libp2p.version.name.html",
|
|
19
|
-
"version": "https://libp2p.github.io/js-libp2p/variables/libp2p.version.version.html",
|
|
20
|
-
"./version:version": "https://libp2p.github.io/js-libp2p/variables/libp2p.version.version.html"
|
|
21
|
-
}
|