chrysn / aiocoap

The Python CoAP library
Other
264 stars 119 forks source link

New composite non-Linux UDP transport #309

Open chrysn opened 1 year ago

chrysn commented 1 year ago

The udp6 transport, while working greatly on Linux, stands little chance in working for non-Linux OSes as long as they lack RECVERR (see recent summary). So, what to do?

The simple6 / simplesocketserver transports are a bit weird because they are separate server/client implementations, and because they don't allow sending from the regular socket address. So, let's assume we have a PKTINFO capable system (it's probably possible on Windows, hard to find someone who can do it, but either way it'd work for the rest of the world).

We'd use

Cloudflare calls this established-over-unconnected.

This should be fully functional in that we are in full control of the addresses, and get errors. The downside compared to udp6 is that we need many sockets while we're sending there. A possible further downside is that when we close sockets, there might be packets lost in their queue between the last recvmsg and the close().

ToDo: