File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 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) {
8484
8585 // Prevent `ws.terminate()` from being called by `duplex._destroy()`.
8686 //
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'`
9090 // event of the `Receiver` object. The listener already closes the
9191 // connection by calling `ws.close()`. This allows a close frame to be
9292 // 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.
9494 terminateOnDestroy = false ;
9595 duplex . destroy ( err ) ;
9696 } ) ;
You can’t perform that action at this time.
0 commit comments