public abstract class SocketIoAdapter
extends io.socket.engineio.server.Emitter
| Modifier and Type | Class and Description |
|---|---|
static interface |
SocketIoAdapter.AdapterFactory
Factory to create new instance of adapter.
|
| Modifier and Type | Field and Description |
|---|---|
protected SocketIoNamespace |
mNamespace
The namespace that this adapter serves.
|
protected Map<String,Set<SocketIoSocket>> |
mRoomSockets
Set of sockets contained within a room.
|
protected Map<String,HashSet<String>> |
mSocketRooms
Set of rooms joined by a socket.
|
| Modifier | Constructor and Description |
|---|---|
protected |
SocketIoAdapter(SocketIoNamespace namespace) |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
add(String room,
SocketIoSocket socket)
Add a socket to the specified room.
|
void |
broadcast(Packet<?> packet,
String[] rooms)
Broadcast a packet to all sockets or sockets that have joined
specified rooms.
|
abstract void |
broadcast(Packet<?> packet,
String[] rooms,
String[] socketsExcluded)
Broadcast a packet to all sockets or sockets that have joined
specified rooms.
|
abstract String[] |
listClientRooms(SocketIoSocket socket)
Get list of rooms joined by socket.
|
abstract SocketIoSocket[] |
listClients(String room)
Get list of sockets in specified room.
|
abstract void |
remove(String room,
SocketIoSocket socket)
Remove a socket from the specified room.
|
protected final SocketIoNamespace mNamespace
protected final Map<String,Set<SocketIoSocket>> mRoomSockets
protected SocketIoAdapter(SocketIoNamespace namespace)
public void broadcast(Packet<?> packet, String[] rooms) throws IllegalArgumentException
packet - Packet to broadcast.rooms - List of rooms to restrict packet to or null to send to all rooms.IllegalArgumentException - If packet is null.public abstract void broadcast(Packet<?> packet, String[] rooms, String[] socketsExcluded) throws IllegalArgumentException
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 abstract void add(String room, SocketIoSocket socket) throws IllegalArgumentException
room - Room name to add socket to.socket - Socket to add to room.IllegalArgumentException - If room or socket is null.public abstract void remove(String room, SocketIoSocket socket) throws IllegalArgumentException
room - Room name to remove socket from.socket - Socket to remove from room.IllegalArgumentException - If room or socket is null.public abstract SocketIoSocket[] listClients(String room) throws IllegalArgumentException
room - Room name to list sockets in.IllegalArgumentException - If room is null.public abstract String[] listClientRooms(SocketIoSocket socket) throws IllegalArgumentException
socket - Socket to list rooms joined.IllegalArgumentException - If socket is null.Copyright © 2022. All rights reserved.