class documentation

class twisted.internet.protocol.AbstractDatagramProtocol: (source)

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

View In Hierarchy

Abstract protocol for datagram-oriented transports, e.g. IP, ICMP, ARP, UDP.

Instance Variable transport Undocumented
Instance Variable numPorts Undocumented
Class Variable noisy Undocumented
Method __getstate__ Undocumented
Method doStart Make sure startProtocol is called.
Method doStop Make sure stopProtocol is called.
Method startProtocol Called when a transport is connected to this protocol.
Method stopProtocol Called when the transport is disconnected.
Method makeConnection Make a connection to a transport and a server.
Method datagramReceived Called when a datagram is received.
transport = (source)

Undocumented

numPorts = (source)

Undocumented

noisy = (source)

Undocumented

(type: bool)
def __getstate__(self): (source)

Undocumented

def doStart(self): (source)

Make sure startProtocol is called.

This will be called by makeConnection(), users should not call it.

def doStop(self): (source)

Make sure stopProtocol is called.

This will be called by the port, users should not call it.

def startProtocol(self): (source)

Called when a transport is connected to this protocol.

Will only be called once, even if multiple ports are connected.

def stopProtocol(self): (source)

Called when the transport is disconnected.

Will only be called once, after all ports are disconnected.

def makeConnection(self, transport): (source)

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): (source)

Called when a datagram is received.

Parametersdatagramthe bytes received from the transport. (type: bytes)
addrtuple of source of datagram.
API Documentation for Twisted, generated by pydoctor 20.12.1 at 2021-02-28 19:53:36.