File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -84,13 +84,13 @@ function createWebSocketStream(ws, options) {
84
84
85
85
// Prevent `ws.terminate()` from being called by `duplex._destroy()`.
86
86
//
87
- // - If the state of the `WebSocket` connection is `CONNECTING`,
88
- // `ws.terminate()` is a noop as no socket was assigned.
89
- // - Otherwise, the error was re-emitted from the listener of the `'error'`
87
+ // - If the `'error'` event is emitted before the `'open'` event, then
88
+ // `ws.terminate()` is a noop as no socket is assigned.
89
+ // - Otherwise, the error is re-emitted by the listener of the `'error'`
90
90
// event of the `Receiver` object. The listener already closes the
91
91
// connection by calling `ws.close()`. This allows a close frame to be
92
92
// sent to the other peer. If `ws.terminate()` is called right after this,
93
- // the close frame might not be sent.
93
+ // then the close frame might not be sent.
94
94
terminateOnDestroy = false ;
95
95
duplex . destroy ( err ) ;
96
96
} ) ;
You can’t perform that action at this time.
0 commit comments