pyre-cli 3.6.0 → 3.7.0
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.js +9 -9
- package/package.json +1 -1
- package/src/p2p/client.ts +9 -9
package/dist/index.js
CHANGED
|
@@ -2354,22 +2354,22 @@ var P2PClient = class {
|
|
|
2354
2354
|
tlsOptions.ca = fs3.readFileSync(this.options.tlsCA);
|
|
2355
2355
|
}
|
|
2356
2356
|
this.socket = tls2.connect(tlsOptions, () => {
|
|
2357
|
-
this.
|
|
2357
|
+
this.running = true;
|
|
2358
|
+
this.status("Connected");
|
|
2359
|
+
resolve();
|
|
2358
2360
|
});
|
|
2359
2361
|
} else {
|
|
2360
2362
|
this.socket = new net2.Socket();
|
|
2361
|
-
this.socket.on("data", (data) => this.onData(data));
|
|
2362
|
-
this.socket.on("close", () => this.onClose());
|
|
2363
|
-
this.socket.on("error", (err) => this.onError(err));
|
|
2364
|
-
this.socket.on("timeout", () => this.onTimeout());
|
|
2365
2363
|
this.socket.setTimeout(1e4);
|
|
2366
2364
|
this.socket.connect(this.options.port, this.options.host, () => {
|
|
2367
|
-
this.
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
reject(err);
|
|
2365
|
+
this.running = true;
|
|
2366
|
+
this.status("Connected");
|
|
2367
|
+
resolve();
|
|
2371
2368
|
});
|
|
2372
2369
|
}
|
|
2370
|
+
this.socket.once("error", (err) => {
|
|
2371
|
+
reject(err);
|
|
2372
|
+
});
|
|
2373
2373
|
this.socket.on("data", (data) => this.onData(data));
|
|
2374
2374
|
this.socket.on("close", () => this.onClose());
|
|
2375
2375
|
this.socket.on("error", (err) => this.onError(err));
|
package/package.json
CHANGED
package/src/p2p/client.ts
CHANGED
|
@@ -63,23 +63,23 @@ export class P2PClient {
|
|
|
63
63
|
tlsOptions.ca = fs.readFileSync(this.options.tlsCA);
|
|
64
64
|
}
|
|
65
65
|
this.socket = tls.connect(tlsOptions, () => {
|
|
66
|
-
this.
|
|
66
|
+
this.running = true;
|
|
67
|
+
this.status('Connected');
|
|
68
|
+
resolve();
|
|
67
69
|
});
|
|
68
70
|
} else {
|
|
69
71
|
this.socket = new net.Socket();
|
|
70
|
-
this.socket.on('data', (data) => this.onData(data));
|
|
71
|
-
this.socket.on('close', () => this.onClose());
|
|
72
|
-
this.socket.on('error', (err) => this.onError(err));
|
|
73
|
-
this.socket.on('timeout', () => this.onTimeout());
|
|
74
72
|
this.socket.setTimeout(10000);
|
|
75
73
|
this.socket.connect(this.options.port, this.options.host, () => {
|
|
76
|
-
this.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
reject(err);
|
|
74
|
+
this.running = true;
|
|
75
|
+
this.status('Connected');
|
|
76
|
+
resolve();
|
|
80
77
|
});
|
|
81
78
|
}
|
|
82
79
|
|
|
80
|
+
this.socket.once('error', (err) => {
|
|
81
|
+
reject(err);
|
|
82
|
+
});
|
|
83
83
|
this.socket.on('data', (data) => this.onData(data));
|
|
84
84
|
this.socket.on('close', () => this.onClose());
|
|
85
85
|
this.socket.on('error', (err) => this.onError(err));
|