class documentation

class MemoryDatagramTransport: (source)

Implements interfaces: twisted.internet.interfaces.IUDPTransport

View In Hierarchy

This IUDPTransport implementation enforces the usual connection rules and captures sent traffic in a list for later inspection.

Method __init__ Undocumented
Method connect Connect this transport to the given address.
Method getBroadcastAllowed Dummy implementation to satisfy IUDPTransport.
Method getHost Return the address which this transport is pretending to be bound to.
Method setBroadcastAllowed Dummy implementation to satisfy IUDPTransport.
Method stopListening Shut down this transport.
Method write Send the given datagram.
Instance Variable _connectedTo None if this transport is unconnected, otherwise an address to which all traffic is supposedly sent.
Instance Variable _host The host address to which this transport is bound.
Instance Variable _maxPacketSize An int giving the maximum length of a datagram which will be successfully handled by write.
Instance Variable _protocol The protocol connected to this transport.
Instance Variable _sentPackets A list of two-tuples of the datagrams passed to write and the addresses to which they are destined.
def __init__(self, host, protocol, maxPacketSize): (source)

Undocumented

def connect(self, host, port): (source)

Connect this transport to the given address.

def getBroadcastAllowed(self): (source)

Dummy implementation to satisfy IUDPTransport.

def getHost(self): (source)

Return the address which this transport is pretending to be bound to.

def setBroadcastAllowed(self, enabled): (source)

Dummy implementation to satisfy IUDPTransport.

def stopListening(self): (source)

Shut down this transport.

def write(self, datagram, addr=None): (source)

Send the given datagram.

_connectedTo = (source)

None if this transport is unconnected, otherwise an address to which all traffic is supposedly sent.

The host address to which this transport is bound.

_maxPacketSize = (source)

An int giving the maximum length of a datagram which will be successfully handled by write.

_protocol = (source)

The protocol connected to this transport.

_sentPackets: list = (source)

A list of two-tuples of the datagrams passed to write and the addresses to which they are destined.