Platypush documentation


Platypush documentation


class platypush.plugins.udp.UdpPlugin(**kwargs)[source]

Bases: Plugin

Plugin for raw UDP communications.

send(data: Union[bytes, str], host: str, port: int, binary: bool = False, timeout: Optional[float] = None, recv_response: bool = False, **recv_opts)[source]

Send data over a UDP connection.

  • data – Data to be sent, as bytes or string.

  • host – Host IP/name.

  • port – TCP port.

  • binary – If set to True and data is a string then will be treated as base64-encoded binary input.

  • timeout – Connection timeout in seconds (default: None).

  • recv_response – If True then the action will wait for a response from the server before closing the connection. Note that recv_opts must be specified in this case - at least length.