pusher / NWWebSocket

A WebSocket client written in Swift, using the Network framework from Apple.
MIT License
123 stars 25 forks source link

Resolve a race condition when immediately attempting to reconnect after a disconnection #24

Closed danielrbrowne closed 3 years ago

danielrbrowne commented 3 years ago

This PR resolves #23:

N.B: This should prevent a race condition that could occur where a reconnection attempt made by calling connect() immediately after receiving a webSocketDidDisconnect(…) callback would fail as the connection was not yet torn down, and therefore calling connect() would do nothing.