Go to the latest version of this document.

# ``twisted`.`internet`.`interfaces`.`IMulticastTransport``

interface documentation

`class IMulticastTransport(IUDPTransport): (source)`

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

View In Hierarchy

Additional functionality for multicast UDP.

Method | `getLoopbackMode` | Return if loopback mode is enabled.
Method | `getOutgoingInterface` | Return interface of outgoing multicast packets.
Method | `getTTL` | Get time to live for multicast packets.
Method | `joinGroup` | Join a multicast group. Returns `Deferred` of success or failure.
Method | `leaveGroup` | Leave multicast group, return `Deferred` of success.
Method | `setLoopbackMode` | Set if loopback mode is enabled.
Method | `setOutgoingInterface` | Set interface for outgoing multicast packets.
Method | `setTTL` | Set time to live on multicast packets.

Inherited from `IUDPTransport`:

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

Return if loopback mode is enabled.

def getOutgoingInterface() -> `str | int`: (source)

Return interface of outgoing multicast packets.

def getTTL() -> `int`: (source)

Get time to live for multicast packets.

def joinGroup(addr: `str`, interface: `str` = '') -> `Deferred[None]`: (source)

Join a multicast group. Returns `Deferred` of success or failure.

If an error occurs, the returned `Deferred` will fail with `error.MulticastJoinError`.

def leaveGroup(addr: `str`, interface: `str` = '') -> `Deferred[None]`: (source)

Leave multicast group, return `Deferred` of success.

def setLoopbackMode(mode: `bool`): (source)

Set if loopback mode is enabled.

def setOutgoingInterface(addr: `str | int`) -> `Deferred[int]`: (source)

Set interface for outgoing multicast packets.

Returns
`Deferred[int]` | Deferred of (1: success, 0: failure).

Note
For IPv4 multicast sockets, the address must be a hostname or IP address. For IPv6 multicast sockets, the address must be an interface index, as described in `socket.if_nameindex`.

def setTTL(ttl: `int`): (source)

Set time to live on multicast packets.