Class NamespaceClient
java.lang.Object
com.corundumstudio.socketio.transport.NamespaceClient
- All Implemented Interfaces:
ClientOperations,SocketIOClient,Store
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidDisconnect clientboolean<T> TGet all rooms a client is joined in.intgetCurrentRoomSize(String room) Get current room Size (contain in cluster)Engine IO Protocol versionHandshake data used during client connectionClient namespaceGet client remote addressClient session id, usesUUIDobjectCurrent client transport protocolbooleaninthashCode()booleanCheck is underlying channel openbooleanReturns true if and only if the I/O thread will perform the requested write operation immediately.voidJoin client to roomvoidJoin client to roomsvoidLeave client from roomvoidleaveRooms(Set<String> rooms) Leave client from roomsvoidvoidSend custom packet.voidsend(Packet packet, AckCallback<?> ackCallback) Send packet with ack callbackvoidsendEvent(String name, AckCallback<?> ackCallback, Object... data) Send event with ack callbackvoidSend eventvoid
-
Constructor Details
-
NamespaceClient
-
-
Method Details
-
getBaseClient
-
getTransport
Description copied from interface:SocketIOClientCurrent client transport protocol- Specified by:
getTransportin interfaceSocketIOClient- Returns:
- transport protocol
-
getEngineIOVersion
Description copied from interface:SocketIOClientEngine IO Protocol version- Specified by:
getEngineIOVersionin interfaceSocketIOClient- Returns:
-
isChannelOpen
public boolean isChannelOpen()Description copied from interface:SocketIOClientCheck is underlying channel open- Specified by:
isChannelOpenin interfaceSocketIOClient- Returns:
trueif channel open, otherwisefalse
-
getNamespace
Description copied from interface:SocketIOClientClient namespace- Specified by:
getNamespacein interfaceSocketIOClient- Returns:
- - namespace
-
sendEvent
Description copied from interface:ClientOperationsSend event- Specified by:
sendEventin interfaceClientOperations- Parameters:
name- - event namedata- - event data
-
sendEvent
Description copied from interface:SocketIOClientSend event with ack callback- Specified by:
sendEventin interfaceSocketIOClient- Parameters:
name- - event nameackCallback- - ack callbackdata- - event data
-
isWritable
public boolean isWritable()Description copied from interface:SocketIOClientReturns 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:
isWritablein interfaceSocketIOClient- Returns:
-
send
Description copied from interface:SocketIOClientSend packet with ack callback- Specified by:
sendin interfaceSocketIOClient- Parameters:
packet- - packet to sendackCallback- - ack callback
-
send
Description copied from interface:ClientOperationsSend custom packet. ButClientOperations.sendEvent(java.lang.String, java.lang.Object...)method usage is enough for most cases.- Specified by:
sendin interfaceClientOperations- Parameters:
packet- - packet to send
-
onDisconnect
public void onDisconnect() -
disconnect
public void disconnect()Description copied from interface:ClientOperationsDisconnect client- Specified by:
disconnectin interfaceClientOperations
-
getSessionId
Description copied from interface:SocketIOClientClient session id, usesUUIDobject- Specified by:
getSessionIdin interfaceSocketIOClient- Returns:
- - session id
-
getRemoteAddress
Description copied from interface:SocketIOClientGet client remote address- Specified by:
getRemoteAddressin interfaceSocketIOClient- Returns:
- remote address
-
hashCode
public int hashCode() -
equals
-
joinRoom
Description copied from interface:SocketIOClientJoin client to room- Specified by:
joinRoomin interfaceSocketIOClient- Parameters:
room- - name of room
-
joinRooms
Description copied from interface:SocketIOClientJoin client to rooms- Specified by:
joinRoomsin interfaceSocketIOClient- Parameters:
rooms- - names of rooms
-
leaveRoom
Description copied from interface:SocketIOClientLeave client from room- Specified by:
leaveRoomin interfaceSocketIOClient- Parameters:
room- - name of room
-
leaveRooms
Description copied from interface:SocketIOClientLeave client from rooms- Specified by:
leaveRoomsin interfaceSocketIOClient- Parameters:
rooms- - names of rooms
-
set
-
get
-
has
-
del
-
getAllRooms
Description copied from interface:SocketIOClientGet all rooms a client is joined in.- Specified by:
getAllRoomsin interfaceSocketIOClient- Returns:
- name of rooms
-
getCurrentRoomSize
Description copied from interface:SocketIOClientGet current room Size (contain in cluster)- Specified by:
getCurrentRoomSizein interfaceSocketIOClient- Parameters:
room- - name of room- Returns:
- int
-
getHandshakeData
Description copied from interface:SocketIOClientHandshake data used during client connection- Specified by:
getHandshakeDatain interfaceSocketIOClient- Returns:
- HandshakeData
-