@peerbit/stream 1.0.7 → 1.0.8
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/lib/esm/index.js +3 -3
- package/package.json +4 -4
- package/src/index.ts +3 -3
package/lib/esm/index.js
CHANGED
|
@@ -415,7 +415,7 @@ export class DirectStream extends EventEmitter {
|
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
417
|
// This condition seem to work better than the one above, for some reason.
|
|
418
|
-
// The reason we need this at all is because we will connect to existing connection and
|
|
418
|
+
// The reason we need this at all is because we will connect to existing connection and receive connection that
|
|
419
419
|
// some times, yields a race connections where connection drop each other by reset
|
|
420
420
|
let stream = undefined; // TODO types
|
|
421
421
|
let tries = 0;
|
|
@@ -850,7 +850,7 @@ export class DirectStream extends EventEmitter {
|
|
|
850
850
|
await this.publishMessage(this.components.peerId, new Pong(message.pingBytes), [peerStream]);
|
|
851
851
|
}
|
|
852
852
|
else if (message instanceof Pong) {
|
|
853
|
-
// Let the (waiting) thread know that we have
|
|
853
|
+
// Let the (waiting) thread know that we have received the pong
|
|
854
854
|
peerStream.pingJob?.resolve();
|
|
855
855
|
}
|
|
856
856
|
else {
|
|
@@ -1070,7 +1070,7 @@ export class DirectStream extends EventEmitter {
|
|
|
1070
1070
|
await id.waitForWrite(bytes);
|
|
1071
1071
|
}
|
|
1072
1072
|
if (!sentOnce && !relayed) {
|
|
1073
|
-
throw new Error("Message did not have any valid
|
|
1073
|
+
throw new Error("Message did not have any valid receivers. ");
|
|
1074
1074
|
}
|
|
1075
1075
|
}
|
|
1076
1076
|
async maybeConnectDirectly(path) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peerbit/stream",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "A building block for direct streaming protocols",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"@dao-xyz/borsh": "^5.1.5",
|
|
59
59
|
"@libp2p/topology": "^4.0.1",
|
|
60
60
|
"@peerbit/cache": "1.0.2",
|
|
61
|
-
"@peerbit/crypto": "1.0.
|
|
62
|
-
"@peerbit/stream-interface": "^1.0.
|
|
61
|
+
"@peerbit/crypto": "1.0.5",
|
|
62
|
+
"@peerbit/stream-interface": "^1.0.6",
|
|
63
63
|
"abstract-level": "^1.0.3",
|
|
64
64
|
"graphology": "0.25.1",
|
|
65
65
|
"graphology-shortest-path": "2.0.2",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"memory-level": "^1.0.0",
|
|
68
68
|
"yallist": "^4.0.0"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "464e807d679e24b897b7811ac99d6f85fbd756f9"
|
|
71
71
|
}
|
package/src/index.ts
CHANGED
|
@@ -601,7 +601,7 @@ export abstract class DirectStream<
|
|
|
601
601
|
}
|
|
602
602
|
|
|
603
603
|
// This condition seem to work better than the one above, for some reason.
|
|
604
|
-
// The reason we need this at all is because we will connect to existing connection and
|
|
604
|
+
// The reason we need this at all is because we will connect to existing connection and receive connection that
|
|
605
605
|
// some times, yields a race connections where connection drop each other by reset
|
|
606
606
|
|
|
607
607
|
let stream: Stream = undefined as any; // TODO types
|
|
@@ -1171,7 +1171,7 @@ export abstract class DirectStream<
|
|
|
1171
1171
|
[peerStream]
|
|
1172
1172
|
);
|
|
1173
1173
|
} else if (message instanceof Pong) {
|
|
1174
|
-
// Let the (waiting) thread know that we have
|
|
1174
|
+
// Let the (waiting) thread know that we have received the pong
|
|
1175
1175
|
peerStream.pingJob?.resolve();
|
|
1176
1176
|
} else {
|
|
1177
1177
|
throw new Error("Unsupported");
|
|
@@ -1432,7 +1432,7 @@ export abstract class DirectStream<
|
|
|
1432
1432
|
await id.waitForWrite(bytes);
|
|
1433
1433
|
}
|
|
1434
1434
|
if (!sentOnce && !relayed) {
|
|
1435
|
-
throw new Error("Message did not have any valid
|
|
1435
|
+
throw new Error("Message did not have any valid receivers. ");
|
|
1436
1436
|
}
|
|
1437
1437
|
}
|
|
1438
1438
|
|