@minip2p/core 0.11.3 → 0.11.4
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/README.md +2 -2
- package/dist/types.d.ts +4 -4
- package/package.json +1 -1
- package/src/types.ts +4 -4
package/README.md
CHANGED
|
@@ -62,12 +62,12 @@ const endpoint = Minip2p.create({
|
|
|
62
62
|
});
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
`timeouts` overrides the protocol deadlines, in milliseconds: `negotiationMs` (one outbound stream's protocol negotiation), `identifyMs` (the time a connection's first Identify may take, its negotiation included; the connection is closed if it fails or runs out) and `pingMs` (one ping, from opening its stream to the echo). `identifyMs`
|
|
65
|
+
`timeouts` overrides the protocol deadlines, in milliseconds: `negotiationMs` (one outbound stream's protocol negotiation), `identifyMs` (the time a connection's first Identify may take, its negotiation included; the connection is closed if it fails or runs out) and `pingMs` (one ping, from opening its stream to the echo). `negotiationMs` and `identifyMs` default to 30 s and `pingMs` to 10 s; omitted fields keep their default. On a slow or loaded link, size them from how long each exchange actually takes there, plus slack for a retransmission. `waitPeerReady`'s default timeout allows a connect plus `identifyMs`. A zero throws `InvalidConfigError` with capability `Options`. Unlike `limits`, `timeouts` applies in `@minip2p/web` too. The `minip2p-rs` README's Deadlines table lists every deadline and how they relate.
|
|
66
66
|
|
|
67
67
|
```ts
|
|
68
68
|
const endpoint = Minip2p.create({
|
|
69
69
|
secretKey,
|
|
70
|
-
timeouts: { negotiationMs:
|
|
70
|
+
timeouts: { negotiationMs: 45_000, identifyMs: 45_000 },
|
|
71
71
|
});
|
|
72
72
|
```
|
|
73
73
|
|
package/dist/types.d.ts
CHANGED
|
@@ -113,10 +113,10 @@ export interface Minip2pYamuxLimits {
|
|
|
113
113
|
}
|
|
114
114
|
/**
|
|
115
115
|
* Protocol deadline overrides, in milliseconds; omitted fields keep the native
|
|
116
|
-
* defaults (30 s for `identifyMs`, 10 s for
|
|
117
|
-
* throw `InvalidConfigError` with capability `Options`.
|
|
118
|
-
* `pingMs` each cover their own negotiation, which
|
|
119
|
-
* cut short.
|
|
116
|
+
* defaults (30 s for `negotiationMs` and `identifyMs`, 10 s for `pingMs`). A
|
|
117
|
+
* zero makes `create` throw `InvalidConfigError` with capability `Options`.
|
|
118
|
+
* `identifyMs` and `pingMs` each cover their own negotiation, which
|
|
119
|
+
* `negotiationMs` does not cut short.
|
|
120
120
|
*/
|
|
121
121
|
export interface Minip2pTimeouts {
|
|
122
122
|
/** How long an outbound stream may negotiate its protocol. */
|
package/package.json
CHANGED
package/src/types.ts
CHANGED
|
@@ -124,10 +124,10 @@ export interface Minip2pYamuxLimits {
|
|
|
124
124
|
|
|
125
125
|
/**
|
|
126
126
|
* Protocol deadline overrides, in milliseconds; omitted fields keep the native
|
|
127
|
-
* defaults (30 s for `identifyMs`, 10 s for
|
|
128
|
-
* throw `InvalidConfigError` with capability `Options`.
|
|
129
|
-
* `pingMs` each cover their own negotiation, which
|
|
130
|
-
* cut short.
|
|
127
|
+
* defaults (30 s for `negotiationMs` and `identifyMs`, 10 s for `pingMs`). A
|
|
128
|
+
* zero makes `create` throw `InvalidConfigError` with capability `Options`.
|
|
129
|
+
* `identifyMs` and `pingMs` each cover their own negotiation, which
|
|
130
|
+
* `negotiationMs` does not cut short.
|
|
131
131
|
*/
|
|
132
132
|
export interface Minip2pTimeouts {
|
|
133
133
|
/** How long an outbound stream may negotiate its protocol. */
|