Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`internet`.`interfaces`.`IUDPTransport``

interface documentation

`class IUDPTransport(Interface): (source)`

Known implementations: `twisted.internet.iocpreactor.udp.Port`, `twisted.internet.udp.Port`

View In Hierarchy

Transport for UDP DatagramProtocols.

Method | `connect` | Connect the transport to an address.
Method | `getBroadcastAllowed` | Checks if broadcast is currently allowed on this port.
Method | `getHost` | Get this port's host address.
Method | `setBroadcastAllowed` | Set whether this port may broadcast.
Method | `stopListening` | Stop listening on this port.
Method | `write` | Write packet to given address.

def connect(host, port): (source)

Connect the transport to an address.

This changes it to connected mode. Datagrams can only be sent to this address, and will only be received from this address. In addition the protocol's connectionRefused method might get called if destination is not receiving datagrams.

Parameters
host:`str` | an IP address, not a domain name ('127.0.0.1', not 'localhost')
port:`int` | port to connect to.

def getBroadcastAllowed(): (source)

Checks if broadcast is currently allowed on this port.

Returns
`bool` | Whether this port may broadcast.

def getHost(): (source)

Get this port's host address.

Returns
`Union[IPv4Address, IPv6Address]` | an address describing the listening port.

def setBroadcastAllowed(enabled): (source)

Set whether this port may broadcast.

Parameters
enabled:`bool` | Whether the port may broadcast.

def stopListening(): (source)

Stop listening on this port.

If it does not complete immediately, will return `Deferred` that fires upon completion.

Returns
`Optional[Deferred]` | Undocumented

def write(packet, addr): (source)

Write packet to given address.

Parameters
packet:`bytes` | Undocumented
addr:`Optional[Tuple[str, int]]` | a tuple of (ip, port). For connected transports must be the address the transport is connected to, or None. In non-connected mode this is mandatory.
Raises
`twisted.internet.error.MessageLengthError` | `packet` was too long.