Package com.adobe.granite.socketio
Interface SocketIOListener
-
@ConsumerType public interface SocketIOListener
Socket.IO listener.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
handleNamespace(String name)
Checks whether this listener wants to handle events for the given namespace.void
onConnect(SocketIOSocket socket)
Called when a socket connects.void
onDisconnect(SocketIOSocket socket, String reason)
Called when a socket disconnects.
-
-
-
Method Detail
-
handleNamespace
boolean handleNamespace(@Nonnull String name)
Checks whether this listener wants to handle events for the given namespace.- Parameters:
name
- name of the namespace to check.- Returns:
true
if this listener will handle events for this namespace.
-
onConnect
void onConnect(@Nonnull SocketIOSocket socket)
Called when a socket connects.- Parameters:
socket
- the socket.
-
onDisconnect
void onDisconnect(@Nonnull SocketIOSocket socket, @Nullable String reason)
Called when a socket disconnects. Note that prior to this, the socket listener on the socket is called.- Parameters:
socket
- the socket that disconnected.reason
- informative reason
-
-