Skip to content

Commit

Permalink
fix: Allow destroying socket while connecting (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
jesperjohansson committed Jan 30, 2023
1 parent a3a11e0 commit 54cc248
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ export default class Socket extends EventEmitter {
* Ensures that no more I/O activity happens on this socket. Destroys the stream and closes the connection.
*/
destroy() {
if (this._pending || this._destroyed) return this;
if (this._destroyed) return this;
this._destroyed = true;
this._clearTimeout();
Sockets.destroy(this._id);
Expand Down

0 comments on commit 54cc248

Please sign in to comment.