vapor / websocket-kit

WebSocket client library built on SwiftNIO
https://docs.vapor.codes/4.0/advanced/websockets/
MIT License
272 stars 79 forks source link

Add channelInactive callback to mark WebSocket as closed. #60

Closed bridger closed 4 years ago

bridger commented 4 years ago

The channelInactive callback is triggered when a WebSocket closes without sending a close code. Previously, the WebSocket.onClose future was still fulfilled but WebSocket.isClosed would be false and WebSocket.closeCode would be nil. This would later cause an assertion when WebSocket deinitialized. Now the onClose future is still fulfilled, but while also setting isClosed and closeCode (#60, fixes https://github.com/vapor/vapor/issues/2107).

tanner0101 commented 4 years ago

These changes are now available in 2.0.0-beta.2.4