Go to the latest version of this document.

# ``twisted`.`internet`.`protocol`.`DatagramProtocol``

class documentation

`class DatagramProtocol(AbstractDatagramProtocol): (source)`

Known subclasses: `twisted.internet.protocol.ConnectedDatagramProtocol`, `twisted.names.dns.DNSDatagramProtocol`, `twisted.protocols.sip.Base`

Implements interfaces: `twisted.internet.interfaces.ILoggingContext`

View In Hierarchy

Protocol for datagram-oriented transport, e.g. UDP.

Method | `connectionRefused` | Called due to error from write in connected mode.
Method | `logPrefix` | Return a prefix matching the class name, to identify log messages related to this protocol instance.
Instance Variable | `transport` | The transport with which this protocol is associated, if it is associated with one.

Inherited from `AbstractDatagramProtocol`:

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

def connectionRefused(self): (source)

Called due to error from write in connected mode.

Note this is a result of ICMP message generated by *previous* write.

def logPrefix(self): (source)
from `twisted.internet.interfaces.ILoggingContext`

Return a prefix matching the class name, to identify log messages related to this protocol instance.

transport: `None` or `IUDPTransport` provider = (source)
overrides `twisted.internet.protocol.AbstractDatagramProtocol.transport`
overridden in `twisted.names.dns.DNSDatagramProtocol`

The transport with which this protocol is associated, if it is associated with one.