jetblack_datagram

async function jetblack_datagram.start_udp_server

Summary

Create a datagram server.

async jetblack_datagram.start_udp_server(
addr: Address,
*,
loop: Optional[AbstractEventLoop],
maxreadqueue: int
) -> DatagramServer

Parameters

addr: Address

The address of the server

loop: Optional[AbstractEventLoop] (optional)

The asyncio event loop. Defaults to None.

maxreadqueue: int (optional)

The maximum size of the read queue. Defaults to 0.

Returns

DatagramServer: A datagram server.

async function jetblack_datagram.open_udp_connection

Summary

Create a datagram client.

async jetblack_datagram.open_udp_connection(
addr: Address,
*,
loop: Optional[AbstractEventLoop],
maxreadqueue: int
) -> DatagramClient

Parameters

addr: Address

The address of the server.

loop: Optional[AbstractEventLoop] (optional)

THe asyncio event loop. Defaults to None.

maxreadqueue: int (optional)

The maximum size of the read queue. Defaults to 0.

Returns

DatagramClient: [description]

class DatagramBase

Summary

Initialise the datagram base class

jetblack_datagram.DatagramBase(
base: DatagramProtocolImpl
) -> None

Parameters

base: DatagramProtocolImpl

The datagram protocol implementation.

method DatagramBase.abort

Summary

Close immediately without waiting for pending operations to complete.

Description

Any buffered data will be lost.

DatagramBase.abort() -> None

method DatagramBase.close

Summary

Close the connection

DatagramBase.close() -> None

async method DatagramBase.wait_closed

Summary

Wait until the connection is closed.

Description

Can be called after closing the connection.

async DatagramBase.wait_closed() -> None

class DatagramServer(DatagramBase)

Summary

Initialise the datagram base class

jetblack_datagram.DatagramServer(
base: DatagramProtocolImpl
) -> None

Parameters

base: DatagramProtocolImpl

The datagram protocol implementation.

method DatagramServer.abort

Summary

Close immediately without waiting for pending operations to complete.

Description

Any buffered data will be lost.

DatagramServer.abort() -> None

method DatagramServer.close

Summary

Close the connection

DatagramServer.close() -> None

async method DatagramServer.recvfrom

Summary

Read a datagram

async DatagramServer.recvfrom() -> Tuple[bytes, Address]

Returns

Tuple[bytes, Address]: THe message and address of the sender.

method DatagramServer.sendto

Summary

Send a datagram

DatagramServer.sendto(
data: bytes,
addr: Union[Address, str]
) -> None

Parameters

data: bytes

The data to send

addr: Union[Address, str]

The address of the recipient.

async method DatagramServer.wait_closed

Summary

Wait until the connection is closed.

Description

Can be called after closing the connection.

async DatagramServer.wait_closed() -> None

class DatagramClient(DatagramBase)

Summary

Initialise the datagram base class

jetblack_datagram.DatagramClient(
base: DatagramProtocolImpl
) -> None

Parameters

base: DatagramProtocolImpl

The datagram protocol implementation.

method DatagramClient.abort

Summary

Close immediately without waiting for pending operations to complete.

Description

Any buffered data will be lost.

DatagramClient.abort() -> None

method DatagramClient.close

Summary

Close the connection

DatagramClient.close() -> None

async method DatagramClient.recv

Summary

Read a datagram

async DatagramClient.recv() -> bytes

Returns

bytes: THe message.

method DatagramClient.send

Summary

Send the data to the server

DatagramClient.send(
data: bytes
) -> None

Parameters

data: bytes

The data to send.

async method DatagramClient.wait_closed

Summary

Wait until the connection is closed.

Description

Can be called after closing the connection.

async DatagramClient.wait_closed() -> None