Class t.i.p.AbstractDatagramProtocol:

Part of twisted.internet.protocol View Source View In Hierarchy

Known subclasses: twisted.pair.rawudp.RawUDPProtocol, twisted.internet.protocol.DatagramProtocol, twisted.pair.ip.IPProtocol, twisted.pair.ethernet.EthernetProtocol

Abstract protocol for datagram-oriented transports, e.g. IP, ICMP, ARP, UDP.
Line # Kind Name Docs
461 Method __getstate__ Undocumented
466 Method doStart Make sure startProtocol is called.
477 Method doStop Make sure stopProtocol is called.
490 Method startProtocol Called when a transport is connected to this protocol.
496 Method stopProtocol Called when the transport is disconnected.
502 Method makeConnection Make a connection to a transport and a server.
512 Method datagramReceived Called when a datagram is received.
def __getstate__(self):
Undocumented
def doStart(self):

Make sure startProtocol is called.

This will be called by makeConnection(), users should not call it.
def doStop(self):

Make sure stopProtocol is called.

This will be called by the port, users should not call it.
def startProtocol(self):

Called when a transport is connected to this protocol.

Will only be called once, even if multiple ports are connected.
def stopProtocol(self):

Called when the transport is disconnected.

Will only be called once, after all ports are disconnected.
def makeConnection(self, transport):

Make a connection to a transport and a server.

This sets the 'transport' attribute of this DatagramProtocol, and calls the doStart() callback.
def datagramReceived(self, datagram, addr):
Called when a datagram is received.
Parametersdatagramthe string received from the transport.
addrtuple of source of datagram.