Skip to content

Commit 54cc248

Browse files
fix: Allow destroying socket while connecting (Rapsssito#169)
1 parent a3a11e0 commit 54cc248

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Socket.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ export default class Socket extends EventEmitter {
305305
* Ensures that no more I/O activity happens on this socket. Destroys the stream and closes the connection.
306306
*/
307307
destroy() {
308-
if (this._pending || this._destroyed) return this;
308+
if (this._destroyed) return this;
309309
this._destroyed = true;
310310
this._clearTimeout();
311311
Sockets.destroy(this._id);

0 commit comments

Comments
 (0)