On readme:
// UseWebSocket#terminate()and notWebSocket#close().
There is this line. But it does not explain why, and I dived into the codebase and the issues but still could not find a reason. Can we include this information somewhere?
ws.terminate() immediately destroys the connection, ws.close() waits for close timer to expire before destroying the connection if the other peer is not responsive.
Technically both can be used but ws.terminate() is better in that example (you don't want to wait another 30 sec before the websocket emits the 'close' event). Feel free to open a PR.
Most helpful comment
ws.terminate()immediately destroys the connection,ws.close()waits for close timer to expire before destroying the connection if the other peer is not responsive.Technically both can be used but
ws.terminate()is better in that example (you don't want to wait another 30 sec before the websocket emits the'close'event). Feel free to open a PR.