hio.core.udp.udping

hio.core.udping Module

Module Contents

Classes

Peer

Class to manage non blocking I/O on UDP socket.

Attributes

logger

UDP_MAX_DATAGRAM_SIZE

UDP_MAX_SAFE_PAYLOAD

UDP_MAX_PACKET_SIZE

hio.core.udp.udping.logger[source]
hio.core.udp.udping.UDP_MAX_DATAGRAM_SIZE[source]
hio.core.udp.udping.UDP_MAX_SAFE_PAYLOAD = 548[source]
hio.core.udp.udping.UDP_MAX_PACKET_SIZE[source]
class hio.core.udp.udping.Peer(ha=None, host='', port=55000, bufsize=1024, wl=None, bcast=False)[source]

Bases: object

Class to manage non blocking I/O on UDP socket.

actualBufSizes(self)[source]

Returns duple of the the actual socket send and receive buffer size (send, receive)

open(self)[source]

Opens socket in non blocking mode.

if socket not closed properly, binding socket gets error

OSError: (48, ‘Address already in use’)

reopen(self)[source]

Idempotently open socket

close(self)[source]

Closes socket and logs if any

receive(self)[source]

Perform non blocking read on socket.

returns tuple of form (data, sa) if no data then returns (b’’,None) but always returns a tuple with two elements

send(self, data, da)[source]

Perform non blocking send on socket.

data is string in python2 and bytes in python3 da is destination address tuple (destHost, destPort)