QueuedConnectionReader

class QueuedConnectionReader

Bases: ConnectionReader, QueuedReturn< NetDatagram >

This flavor of ConnectionReader will read from its sockets and queue up all of the datagrams read for later receipt by the client code. This class is useful for client code that doesn’t want to deal with threading and is willing to poll for datagrams at its convenience.

Inheritance diagram

digraph inheritance8225f218a3 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "ConnectionReader" [URL="acron.net.ConnectionReader.html#acron.net.ConnectionReader",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "ConnectionReader" [arrowsize=0.75,style=""]; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "QueuedConnectionReader" [URL="acron.net.QueuedConnectionReader.html#acron.net.QueuedConnectionReader",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "ConnectionReader" -> "QueuedConnectionReader" [arrowsize=0.75,style=""]; "QueuedReturn_NetDatagram" -> "QueuedConnectionReader" [arrowsize=0.75,style=""]; "QueuedReturn_NetDatagram" [URL="acron.net.QueuedReturn_NetDatagram.html#acron.net.QueuedReturn_NetDatagram",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top"]; "DTOOL_SUPER_BASE" -> "QueuedReturn_NetDatagram" [arrowsize=0.75,style=""]; }
QueuedConnectionReader.__init__()
QueuedConnectionReader.data_available()

Returns true if a datagram is available on the queue; call get_data() to extract the datagram.

QueuedConnectionReader.get_data()

If a previous call to data_available() returned true, this function will return the datagram that has become available.

The return value is true if a datagram was successfully returned, or false if there was, in fact, no datagram available. (This may happen if there are multiple threads accessing the QueuedConnectionReader).

This flavor of QueuedConnectionReader::get_data(), works like the other, except that it only fills a Datagram object, not a NetDatagram object. This means that the Datagram cannot be queried for its source Connection and/or NetAddress, but it is useful in all other respects.