Parameters: | loop (Loop) – loop object where this handle runs (accessible through UDP.loop). |
---|
The UDP handle provides asynchronous UDP functionality both as a client and server.
Parameters: |
|
---|
Bind to the specified IP address and port. This function needs to be called always, both when acting as a client and as a server. It sets the local IP address and port from which the data will be sent.
Parameters: | fd (int) – File descriptor to be opened. |
---|
Open the given file descriptor (or SOCKET in Windows) as a UDP handle.
Return tuple containing IP address and port of the local socket. In case of IPv6 sockets, it also returns the flow info and scope ID (a 4 element tuple).
Parameters: |
|
---|
Send data over the UDP connection.
Callback signature: callback(udp_handle, error).
Parameters: |
|
---|
Send data over the UDP connection.
Callback signature: callback(udp_handle, error).
Parameters: | callback (callable) – Callback to be called when data is received on the bount IP address and port. |
---|
Start receiving data on the bound IP address and port.
Callback signature: callback(udp_handle, (ip, port), flags, data, error). The flags attribute can only contain pyuv.UV_UDP_PARTIAL, in case the UDP packet was truncated.
Stop receiving data.
Parameters: |
|
---|
Join or leave a multicast group.
Parameters: | ttl (int) – TTL value to be set. |
---|
Set the multicast Time To Live (TTL).
Parameters: | enable (boolean) – On /off. |
---|
Set IP multicast loop flag. Makes multicast packets loop back to local sockets.
Parameters: | enable (boolean) – On /off. |
---|
Set broadcast on or off.
Parameters: | ttl (int) – TTL value to be set. |
---|
Set the Time To Live (TTL).