Constructor
new Socket()
Methods
addBinaryListener(channel, callback)
- Source:
Listen binary messages on a given channel
Parameters:
Name | Type | Description |
---|---|---|
channel |
String | Channel of the message |
callback |
function | Callback to execute when a message is received |
addListener(channel, callback)
- Source:
Listen JSON compatible messages on a given channel
Parameters:
Name | Type | Description |
---|---|---|
channel |
String | Channel of the message |
callback |
function | Callback to execute when a message is received |
removeAllBinaryListeners(channel)
- Source:
Remove all listeners from binary compatible messages on a given channel
Parameters:
Name | Type | Description |
---|---|---|
channel |
String | Channel of the message |
removeAllListeners(channel)
- Source:
Remove all listeners from JSON compatible messages on a given channel
Parameters:
Name | Type | Description |
---|---|---|
channel |
String | Channel of the message |
removeBinaryListener(channel, callback)
- Source:
Remove a listener from binary compatible messages on a given channel
Parameters:
Name | Type | Description |
---|---|---|
channel |
String | Channel of the message |
callback |
function | Callback to cancel |
removeListener(channel, callback)
- Source:
Remove a listener from JSON compatible messages on a given channel
Parameters:
Name | Type | Description |
---|---|---|
channel |
String | Channel of the message |
callback |
function | Callback to remove |
send(channel, …args)
- Source:
Send JSON compatible messages on a given channel
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
channel |
String | The channel of the message |
|
args |
* |
<repeatable> |
Arguments of the message (as many as needed, of any type) |
sendBinary(channel, typedArray)
- Source:
Send binary messages on a given channel
Parameters:
Name | Type | Description |
---|---|---|
channel |
String | Channel of the message |
typedArray |
TypedArray | Data to send |
terminate()
- Source:
Immediately close the 2 sockets