bibliopixel.util.udp module

A server that queues and sends UDP requests for a specific port on a separate thread.

class bibliopixel.util.udp.QueuedReceiver(*args, **kwds)[source]

Bases: bibliopixel.util.udp.Receiver

Receive UDP messages in a thread and put them on a queue.

receive(msg)[source]
class bibliopixel.util.udp.QueuedSender(address, **kwds)[source]

Bases: bibliopixel.util.threads.runnable.QueueHandler

The UPD protocol is stateless but not necessarily thread-safe.

QueuedSender uses a queue to send all UDP messages to one address from a new thread.

send(msg)[source]
class bibliopixel.util.udp.Receiver(address, bufsize=4096, receive=None, **kwds)[source]

Bases: bibliopixel.util.threads.runnable.LoopThread

Receive UDP messages in a thread

run_once()[source]

The target code that is repeatedly executed in the run method

stop()[source]
class bibliopixel.util.udp.Sender(address)[source]

Bases: bibliopixel.util.threads.runnable.Runnable

send(msg)[source]
bibliopixel.util.udp.sender(address, use_queue=True, **kwds)[source]
Parameters:
  • address (str) – a pair (ip_address, port) to pass to socket.connect
  • use_queue (bool) – if True, run the connection in a different thread with a queue