hypercorn.asyncio.udp_server module

class hypercorn.asyncio.udp_server.UDPServer(app: Union[Type[hypercorn.typing.ASGI2Protocol], Callable[[dict, Callable, Callable], Awaitable[None]]], loop: asyncio.events.AbstractEventLoop, config: hypercorn.config.Config)

Bases: asyncio.protocols.DatagramProtocol

connection_made(transport: asyncio.transports.DatagramTransport) → None

Called when a connection is made.

The argument is the transport representing the pipe connection. To receive data, wait for data_received() calls. When the connection is closed, connection_lost() is called.

datagram_received(data: bytes, address: Tuple[bytes, str]) → None

Called when some datagram is received.

async protocol_send(event: hypercorn.events.Event) → None