aiocoap.util.socknumbers module

This module contains numeric constants that would be expected in the socket module, but are not exposed there.

This gathers both socket numbers that can be present in the socket module (eg. the PKTINFO constants) but are not in some versions (eg. on macOS before <> is fixed) and platform dependent constants that are not generally available at all (the ERR constants).

Where available, the CPython-private IN module is used to obtain some platform specific constants.

Any hints on where to get them from in a more reliable way are appreciated; possible options are parsing C header files (at build time?) or interacting with shared libraries for obtaining the symbols. The right way would probably be including them in Python in a “other constants defined on this platform for sockets” module or dictionary.

aiocoap.util.socknumbers.HAS_RECVERR = True

Indicates whether the discovered constants indicate that the Linux setsockopt(IPV6, RECVERR) / recvmsg(…, MSG_ERRQUEUE) mechanism is available