Open
Description
I'm using the socket.io library in my iOS app, and want to always maintain a connection as long as the app is active, automatically reconnecting after every disconnect . I can do this adding a disconnect handler that reconnects like the following:
socket.on(clientEvent: .disconnect) { args, ack in
self.socket.connect()
}
While this works, it seems that the handler is called for both disconnects due to external causes and disconnects initiated manually (i.e. by calling socket.disconnect()). While you can set flags/remove listeners every time one explicitly calls disconnect, It would be nice to have an easier way of distinguishing these built into the API.