Methods
close(inPort, inCallback)
Close the UDP socket and bind to the specified port.
Parameters:
Name | Type | Description |
---|---|---|
inPort |
integer | port to which to bind, eg 5353 for MDNS |
inCallback |
function | function to call on completion |
- Source:
getHostName() → {string}
Return the host name of the machine.
- Source:
Returns:
host name
- Type
- string
getIPAddress() → {string}
Return the IP address of the machine.
- Source:
Returns:
IP address
- Type
- string
listen(inCallback)
Listen for packets on the UDP socket.
Parameters:
Name | Type | Description |
---|---|---|
inCallback |
function | function to call on reception |
- Source:
open(inPort, inCallback)
Open the UDP socket and bind to the specified port.
Note only one UDP socket per strategy instance.
Parameters:
Name | Type | Description |
---|---|---|
inPort |
integer | port to which to bind, eg 5353 for MDNS |
inCallback |
function | function to call on completion |
- Source:
send(inPacket, inRemoteAddress, inRemotePort)
Send a packet on the UDP socket.
Parameters:
Name | Type | Description |
---|---|---|
inPacket |
ArrayBuffer | packet |
inRemoteAddress |
string | remote address |
inRemotePort |
port | remote port |
- Source:
subscribe(inMulticastAddress, inCallback)
Subscribe the UDP socket to a multicast address.
Parameters:
Name | Type | Description |
---|---|---|
inMulticastAddress |
string | multicast address to join, eg 224.0.0.251 for MDNS |
inCallback |
function | function to call on completion |
- Source: