PyDocs

Nav

Networking and Interprocess Communication

loop.create_datagram_endpoint

asyncio

async methodnot WASI
  • loop.create_datagram_endpoint(protocol_factory, local_addr=None, remote_addr=None, *, family=0, proto=0, flags=0, reuse_port=None, allow_broadcast=None, sock=None)
Create a datagram connection.
Changed in 3.4.4, 3.8, 3.8.1, 3.11
  • 3.4.4: The family, proto, flags, reuse_address, reuse_port, allow_broadcast, and sock parameters were added.
  • 3.8: Added support for Windows.
  • 3.8.1: The reuse_address parameter is no longer supported, as using socket.SO_REUSEADDR poses a significant security concern for UDP. Explicitly passing reuse_address=True will raise an exception. When multiple processes with differing UIDs assign sockets to an identical UDP socket address with SO_REUSEADDR, incoming packets can become randomly distributed among the sockets. For supported platforms, reuse_port can be used as a replacement for similar functionality. With reuse_port, socket.SO_REUSEPORT is used instead, which specifically prevents processes with differing UIDs from assigning sockets to the same socket address.
  • 3.11: The reuse_address parameter, disabled since Python 3.8.1, 3.7.6 and 3.6.10, has been entirely removed.
0 Examples
No examples for asyncio/loop.create_datagram_endpoint.
See Also
No see-alsos for asyncio/loop.create_datagram_endpoint
0 Notes
No notes for loop.create_datagram_endpoint