DatagramSinkNet

from acron.net import DatagramSinkNet
class DatagramSinkNet

Bases:

Bases: DatagramSink, ConnectionWriter

This class accepts datagrams one-at-a-time and sends them over the net, via a TCP connection.

Inheritance diagram

digraph inheritance3162c1715d { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "ConnectionWriter" [URL="acron.net.ConnectionWriter.html#acron.net.ConnectionWriter",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" -> "ConnectionWriter" [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=""]; "DatagramSink" [URL="acron.core.DatagramSink.html#acron.core.DatagramSink",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" -> "DatagramSink" [arrowsize=0.75,style=""]; "DatagramSinkNet" [URL="acron.net.DatagramSinkNet.html#acron.net.DatagramSinkNet",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DatagramSink" -> "DatagramSinkNet" [arrowsize=0.75,style=""]; "ConnectionWriter" -> "DatagramSinkNet" [arrowsize=0.75,style=""]; }
__init__()

Creates a new DatagramSinkNet with the indicated number of threads to handle writing. Normally num_threads should be either 0 or 1 to guarantee that datagrams are delivered in the same order in which they were sent.

flush()

Ensures that all datagrams previously written will be visible on the stream.

get_target()

Returns the current target Connection, or NULL if the target has not yet been set. See set_target().

is_error()

Returns true if there is an error on the target connection, or if the target has never been set.

put_datagram()

Inherited from DatagramSink

Sends the given datagram to the target. Returns true on success, false if there is an error. Blocks if necessary until the target is ready.

set_target()

Specifies the Connection that will receive all future Datagrams sent.