socktools.udp_sock - UDP implementation¶
This module contains the class you probably want most of the time: it implements P2P UDP.
-
class
socktools.udp_sock.UDPSock(bind=None, connect=None, handlers={}, timeout=10, tick_interval=0.25, sock=None, meta_sock=None, logger=None, no_async=False)[source]¶ Bases:
socktools.base_sock.BaseSockSimple UDP implementation - both client and server
Read the code to see just HOW trivially simple this is, application logic belongs elsewhere
-
create_socket(no_reuse=False)[source]¶ Creates the physical socket object
Note
The socket sets SO_REUSEADDR by default, this saves a LOT of time in testing your code, but if you don’t want this behaviour turn it off in child_setup()
Returns: the physical socket object for inbound connections Return type: socket.socket
-