component fathom.socket.multicast
This component provides functions for sending and
receiving multicast messages using UDP over IPv4.
Methods
Methods | Returns | Description |
---|---|---|
closeSocket(
callback
)
|
void
static
|
↑
This function closes a multicast socket.
Parameters:
|
openReceiveSocket(
callback, ip, port
)
|
void
static
|
↑
This function opens a multicast socket and binds
it to the given IP address and port.
Parameters:
|
openSendSocket(
callback, ttl
)
|
void
static
|
↑
This function opens a socket suitable for
transmitting multicast messages.
Parameters:
|
receive(
callback, socketid
)
|
void
static
|
↑
On a socket created via openReceiveSocket(),
this function receives data.
Parameters:
|
receiveDetails(
callback, socketid
)
|
void
static
|
↑
Like receive(), but upon success the callback
receives dictionary with the following key/val structure:
"text" contains the received data, "peer" is another
dictionary with members "ip" for the sender's IPv4 address
and "port" for the sender's port.
Parameters:
|
send(
callback, socketid, msg, ip, port
)
|
void
static
|
↑
This function transmits data via UDP on a
multicast socket.
This function should report the number of bytes successfully transmitted to the callback. The underlying implementation should do better error handling.
Parameters:
|