public final class SocketIoMemoryAdapter extends SocketIoAdapter
Modifier and Type | Class and Description |
---|---|
static class |
SocketIoMemoryAdapter.Factory
Factory for
SocketIoMemoryAdapter class. |
SocketIoAdapter.AdapterFactory
mNamespace, mRoomSockets, mSocketRooms
Modifier and Type | Method and Description |
---|---|
void |
add(String room,
SocketIoSocket socket)
Add a socket to the specified room.
|
void |
broadcast(Packet packet,
String[] rooms,
String[] socketsExcluded)
Broadcast a packet to all sockets or sockets that have joined
specified rooms.
|
String[] |
listClientRooms(SocketIoSocket socket)
Get list of rooms joined by socket.
|
SocketIoSocket[] |
listClients(String room)
Get list of sockets in specified room.
|
void |
remove(String room,
SocketIoSocket socket)
Remove a socket from the specified room.
|
broadcast
public void broadcast(Packet packet, String[] rooms, String[] socketsExcluded) throws IllegalArgumentException
SocketIoAdapter
broadcast
in class SocketIoAdapter
packet
- Packet to broadcast.rooms
- List of rooms to restrict packet to or null to send to all rooms.socketsExcluded
- List of sockets to exclude from sending or null.IllegalArgumentException
- If packet is null.public void add(String room, SocketIoSocket socket) throws IllegalArgumentException
SocketIoAdapter
add
in class SocketIoAdapter
room
- Room name to add socket to.socket
- Socket to add to room.IllegalArgumentException
- If room or socket is null.public void remove(String room, SocketIoSocket socket) throws IllegalArgumentException
SocketIoAdapter
remove
in class SocketIoAdapter
room
- Room name to remove socket from.socket
- Socket to remove from room.IllegalArgumentException
- If room or socket is null.public SocketIoSocket[] listClients(String room) throws IllegalArgumentException
SocketIoAdapter
listClients
in class SocketIoAdapter
room
- Room name to list sockets in.IllegalArgumentException
- If room is null.public String[] listClientRooms(SocketIoSocket socket) throws IllegalArgumentException
SocketIoAdapter
listClientRooms
in class SocketIoAdapter
socket
- Socket to list rooms joined.IllegalArgumentException
- If socket is null.Copyright © 2022. All rights reserved.