-
Notifications
You must be signed in to change notification settings - Fork 3
Description
The original purpose is to regard socket as stateless by forcing user to create a socket action and pass it to server's selector method like all(Action<Socket> action) or byId(String id, Action<Socket> action). However, we have no option but to admit that socket is stateful as it is required to deal with socket whose connection is disconnected for a little while.
A need to expose socket state is to determine socket state at any time of course. For example, user might want to cache some events on cache event which couldn't be sent due to temporal disconnection and send them again on open event. If a connection is broken abruptly in triggering open event handler, it may cause infinite loop so that it should check if socket is in opened state or not.