Skip to content

Add channelInactive callback to mark WebSocket as closed.

Pre-release
Pre-release
Compare
Choose a tag to compare
@tanner0101 tanner0101 released this 26 Feb 20:40
e35af05

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 vapor/vapor#2107).