Methods
addToRoom(socket, roomId)
- Description:
Add a socket to a room
- Source:
Parameters:
Name | Type | Description |
---|---|---|
socket |
server.Socket | Socket to add to the room. |
roomId |
String | Id of the room. |
broadcast(roomsIds, excludeSocket, channel, …args)
- Description:
Send a message of JSON compatible data types to all client of given room(s). If no room is specified, the message is sent to all clients.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
roomsIds |
String | Array | Ids of the rooms that must receive
the message. If |
|
excludeSocket |
server.Socket | Optionnal socket to ignore when broadcasting the message, typically the client at the origin of the message. |
|
channel |
String | Channel name. |
|
args |
* |
<repeatable> |
Payload of the message. As many arguments as needed, of JSON compatible data types (i.e. string, number, boolean, object, array and null). |
broadcastBinary(roomsIds, excludeSocket, channel, typedArray)
- Description:
Send a binary message to all client of given room(s). If no room is specified specified, the message is sent to all clients.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
roomsIds |
String | Array | Ids of the rooms that must receive
the message. If |
excludeSocket |
server.Socket | Optionnal socket to ignore when broadcasting the message, typically the client at the origin of the message. |
channel |
string | Channel name. |
typedArray |
TypedArray | Binary data to be sent. |
removeFromRoom(socket, roomId)
- Description:
Remove a socket from a room
- Source:
Parameters:
Name | Type | Description |
---|---|---|
socket |
server.Socket | Socket to remove from the room. |
roomId |
String | Id of the room. |