Python's asyncio examples show how to create a 'protocol class' for a TCP echo server. The example seems to indicate that these objects spawn for each client connection. In which case: connection_made fires for each new client connection and a 'transport' instance encapsulates a TCP stream socket for the new client.
https://docs.python.org/3/library/asyncio-protocol.html#tcp-echo-server
My question is: to what extent does this behaviour still apply to UDP servers?
My interpretation of the UDP echo server example is that:
- There's one UDP listen socket.
- UDP is not connection-orientated so there is no need for individual client sockets to be spawned. The same socket is reused for all clients.
- Therefore, 'connection_made' would not fire per client. It would fire once, after the server was started.
- In which case: this is quite a lot different to how the TCP echo server works since a new object isn't created per client.
https://docs.python.org/3/library/asyncio-protocol.html#udp-echo-server
Is this correct, or am I missing something?