@decentnetwork/peer 0.1.51 → 0.1.52

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.
@@ -62,6 +62,19 @@ export class UdpTransport extends EventEmitter {
62
62
  const onListening = () => {
63
63
  cleanup();
64
64
  this.#bound = true;
65
+ // Enlarge the kernel socket buffers. The default (often ~64-256 KB) is
66
+ // smaller than a single file-transfer send window (≈ 256 KB) plus the
67
+ // CCTV stream, so sustained bursts overflowed and the kernel silently
68
+ // dropped datagrams — a big file would stick at 0% as its early chunks
69
+ // kept getting dropped. 4 MB absorbs the bursts on both directions.
70
+ try {
71
+ socket.setSendBufferSize(4 * 1024 * 1024);
72
+ }
73
+ catch { /* best-effort */ }
74
+ try {
75
+ socket.setRecvBufferSize(4 * 1024 * 1024);
76
+ }
77
+ catch { /* best-effort */ }
65
78
  resolve();
66
79
  };
67
80
  const onError = (error) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decentnetwork/peer",
3
- "version": "0.1.51",
3
+ "version": "0.1.52",
4
4
  "description": "Pure TypeScript port of Elastos Carrier (toxcore-derived) P2P messaging. DHT, onion routing, TCP relay, FlatBuffers app payloads, Express offline relay. Wire-compatible with iOS Beagle and the Carrier C SDK.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",