public interface SocketIOSocket extends SocketIOEmitter
Modifier and Type | Method and Description |
---|---|
SocketIOEmitter |
broadcast()
Sets a modifier for a subsequent event emission that the event will
sent to all sockets except to itself.
|
SocketIOSocket |
disconnect(boolean close)
Disconnects this socket.
|
SocketIOSocket |
emit(java.lang.String eventName,
SocketIOAckListener ackListener,
JSONArray arguments)
Emits an event to the socket identified by the string name.
|
SocketIOSocket |
emit(java.lang.String eventName,
SocketIOAckListener ackListener,
java.lang.Object... arguments)
Emits an event to the socket identified by the string name.
|
java.lang.String |
getId()
A unique identifier for the socket session, that comes from the underlying Client.
|
SocketIONamespace |
getNamespace()
Client namespace
|
java.util.Set<java.lang.String> |
getRooms()
A list of strings identifying the rooms this socket is in.
|
java.security.Principal |
getUserPrincipal() |
SocketIOSocket |
join(java.lang.String name)
Adds the socket to the room, and fires optionally a callback fn with err signature (if any).
|
SocketIOSocket |
leave(java.lang.String name)
Removes the socket from room, and fires optionally a callback fn
with err signature (if any).
|
SocketIOSocket |
removeListener(SocketIOSocketListener listener)
Removes a listener from this socket.
|
SocketIOSocket |
setListener(SocketIOSocketListener listener)
Sets a listener to this socket that will receive the socket events.
|
emit, emit, to
SocketIOSocket setListener(SocketIOSocketListener listener)
listener
- the listenerjava.lang.IllegalArgumentException
- if this socket already has a listenerSocketIOSocket removeListener(SocketIOSocketListener listener)
listener
- the listenerjava.lang.IllegalArgumentException
- if this socket already has a listener defined that is not the given one.java.lang.String getId()
SocketIONamespace getNamespace()
java.util.Set<java.lang.String> getRooms()
SocketIOSocket disconnect(boolean close)
close
- true
to also close the underlying connectionSocketIOSocket join(java.lang.String name)
name
- room nameSocketIOSocket leave(java.lang.String name)
name
- room nameSocketIOEmitter broadcast()
SocketIOSocket emit(java.lang.String eventName, SocketIOAckListener ackListener, java.lang.Object... arguments) throws java.io.IOException
SocketIOAckListener
that will be called after the client sent the
ack response.eventName
- name of the eventackListener
- the acknowledge listenerarguments
- optional argumentsjava.io.IOException
- errorSocketIOSocket emit(java.lang.String eventName, SocketIOAckListener ackListener, JSONArray arguments) throws java.io.IOException
SocketIOAckListener
that will be called after the client sent the
ack response.eventName
- name of the eventackListener
- the acknowledge listenerarguments
- optional argumentsjava.io.IOException
- errorjava.security.Principal getUserPrincipal()
Principal
of the current authenticated user."Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"