Will await will work with `socket.accept()`


I’m totally new in the asyncio domain…

is a await socket.accept() inside a async function will work ?

or will it block ? can I used anything (that block obviously) after a await ?

Do you know a great tutorials, guides about asyncio ?
Please list the free here and the paid one in private.


It won’t work with socket.accept, but it has its own coroutine modeled after it: Event Loop — Python 3.12.4 documentation

1 Like

I’ve found asyncio.start_unix_server() but it’s weird in it’s argument I don’t see where we can specify SOCK_STREAM or SOCK_DGRAM

It is already specified because you are using asyncio Stream. Use this other coroutine; the socket type will be SOCK_DGRAM.

1 Like

Thanks !

I land on this page asyncio.start_unix_server() after a search and I didn’t saw that it’s was under asyncio Stream :woman_facepalming:

But the name start_unix_server() is alone ambiguous.