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)Engine IO Protocol versionHandshake data used during client connectionClient namespaceGet client remote addressClient session id, usesUUID
objectCurrent client transport protocolboolean
int
hashCode()
boolean
Check is underlying channel openboolean
Returns true if and only if the I/O thread will perform the requested write operation immediately.void
Join client to roomvoid
Join client to roomsvoid
Leave client from roomvoid
leaveRooms
(Set<String> rooms) Leave client from roomsvoid
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
-
getEngineIOVersion
Description copied from interface:SocketIOClient
Engine IO Protocol version- Specified by:
getEngineIOVersion
in interfaceSocketIOClient
- Returns:
-
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
-
isWritable
public boolean isWritable()Description copied from interface:SocketIOClient
Returns true if and only if the I/O thread will perform the requested write operation immediately. Any write requests made when this method returns false are queued until the I/O thread is ready to process the queued write requests.- Specified by:
isWritable
in interfaceSocketIOClient
- Returns:
-
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
-
joinRooms
Description copied from interface:SocketIOClient
Join client to rooms- Specified by:
joinRooms
in interfaceSocketIOClient
- Parameters:
rooms
- - names of rooms
-
leaveRoom
Description copied from interface:SocketIOClient
Leave client from room- Specified by:
leaveRoom
in interfaceSocketIOClient
- Parameters:
room
- - name of room
-
leaveRooms
Description copied from interface:SocketIOClient
Leave client from rooms- Specified by:
leaveRooms
in interfaceSocketIOClient
- Parameters:
rooms
- - names of rooms
-
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
-