Class NamespaceClient
java.lang.Object
com.corundumstudio.socketio.transport.NamespaceClient
- All Implemented Interfaces:
ClientOperations
,SocketIOClient
,Store
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Disconnect clientboolean
<T> T
Get all rooms a client is joined in.int
getCurrentRoomSize
(String room) Get current room Size (contain in cluster)Handshake data used during client connectionClient namespaceGet client remote addressClient session id, usesUUID
objectCurrent client transport protocolboolean
int
hashCode()
boolean
Check is underlying channel openvoid
Join client to roomvoid
Join client to roomvoid
void
Send custom packet.void
send
(Packet packet, AckCallback<?> ackCallback) Send packet with ack callbackvoid
sendEvent
(String name, AckCallback<?> ackCallback, Object... data) Send event with ack callbackvoid
Send eventvoid
-
Constructor Details
-
NamespaceClient
-
-
Method Details
-
getBaseClient
-
getTransport
Description copied from interface:SocketIOClient
Current client transport protocol- Specified by:
getTransport
in interfaceSocketIOClient
- Returns:
- transport protocol
-
isChannelOpen
public boolean isChannelOpen()Description copied from interface:SocketIOClient
Check is underlying channel open- Specified by:
isChannelOpen
in interfaceSocketIOClient
- Returns:
true
if channel open, otherwisefalse
-
getNamespace
Description copied from interface:SocketIOClient
Client namespace- Specified by:
getNamespace
in interfaceSocketIOClient
- Returns:
- - namespace
-
sendEvent
Description copied from interface:ClientOperations
Send event- Specified by:
sendEvent
in interfaceClientOperations
- Parameters:
name
- - event namedata
- - event data
-
sendEvent
Description copied from interface:SocketIOClient
Send event with ack callback- Specified by:
sendEvent
in interfaceSocketIOClient
- Parameters:
name
- - event nameackCallback
- - ack callbackdata
- - event data
-
send
Description copied from interface:SocketIOClient
Send packet with ack callback- Specified by:
send
in interfaceSocketIOClient
- Parameters:
packet
- - packet to sendackCallback
- - ack callback
-
send
Description copied from interface:ClientOperations
Send custom packet. ButClientOperations.sendEvent(java.lang.String, java.lang.Object...)
method usage is enough for most cases.- Specified by:
send
in interfaceClientOperations
- Parameters:
packet
- - packet to send
-
onDisconnect
public void onDisconnect() -
disconnect
public void disconnect()Description copied from interface:ClientOperations
Disconnect client- Specified by:
disconnect
in interfaceClientOperations
-
getSessionId
Description copied from interface:SocketIOClient
Client session id, usesUUID
object- Specified by:
getSessionId
in interfaceSocketIOClient
- Returns:
- - session id
-
getRemoteAddress
Description copied from interface:SocketIOClient
Get client remote address- Specified by:
getRemoteAddress
in interfaceSocketIOClient
- Returns:
- remote address
-
hashCode
public int hashCode() -
equals
-
joinRoom
Description copied from interface:SocketIOClient
Join client to room- Specified by:
joinRoom
in interfaceSocketIOClient
- Parameters:
room
- - name of room
-
leaveRoom
Description copied from interface:SocketIOClient
Join client to room- Specified by:
leaveRoom
in interfaceSocketIOClient
- Parameters:
room
- - name of room
-
set
-
get
-
has
-
del
-
getAllRooms
Description copied from interface:SocketIOClient
Get all rooms a client is joined in.- Specified by:
getAllRooms
in interfaceSocketIOClient
- Returns:
- name of rooms
-
getCurrentRoomSize
Description copied from interface:SocketIOClient
Get current room Size (contain in cluster)- Specified by:
getCurrentRoomSize
in interfaceSocketIOClient
- Parameters:
room
- - name of room- Returns:
- int
-
getHandshakeData
Description copied from interface:SocketIOClient
Handshake data used during client connection- Specified by:
getHandshakeData
in interfaceSocketIOClient
- Returns:
- HandshakeData
-