This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: asyncio/Windows: Unix datagram sockets not supported
Type: enhancement Stage: resolved
Components: asyncio Versions: Python 3.4
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: asvetlov, gvanrossum, rb, vstinner, yselivanov
Priority: normal Keywords:

Created on 2015-09-24 22:14 by rb, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (4)
msg251549 - (view) Author: (rb) * Date: 2015-09-24 22:14
AF_UNIX, SOCK_DGRAM sockets are valid, but asyncio doesn't appear to support them.

I've tried combinations of create_connection, create_datagram_endpoint and create_unix_connection, creating a socket myself and passing in sock, and equivalent methods at the server end. There seem to be implicit assumptions about addresses being 2-tuples (instead of strings) and transports being hardcoded to be constructed as either stream or datagram transports. create_unix_connection makes the assumption that it will be a stream, and create_datagram_endpoint that it will be AF_INET or AF_INET6 with (host, port) addressing.

I used 3.4.3, but looking at the docs it doesn't look like this was addressed in 3.5 either.

I'd like this because message boundaries are preserved (unlike in SOCK_STREAM), which if it Just Worked would make local system IPC (eg. with JSON-RPC) extremely trivial to implement in asyncio.
msg251551 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2015-09-24 22:26
The simplest fix for this IMO is to add a sock parameter to create_datagram_endpoint(). I've filed an issue for this in the upstream asyncio project: https://github.com/python/asyncio/issues/266
msg251589 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2015-09-25 16:45
See https://github.com/python/asyncio/pull/267. Can you patch that in and see if you can make it work?
msg415001 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2022-03-12 17:03
Implemented a long time ago, closing
History
Date User Action Args
2022-04-11 14:58:21adminsetgithub: 69417
2022-03-12 17:03:15asvetlovsetstatus: open -> closed

nosy: + asvetlov
messages: + msg415001

resolution: out of date
stage: resolved
2015-10-12 22:25:55vstinnersettitle: Unix datagram sockets not supported -> asyncio/Windows: Unix datagram sockets not supported
2015-09-25 16:45:17gvanrossumsetmessages: + msg251589
2015-09-24 22:26:04gvanrossumsetmessages: + msg251551
2015-09-24 22:14:21rbcreate