0
votes

If you shutdown a non-blocking socket:

sock.setblocking(False)
...
sock.shutdown(SHUT_RDWR)

is it possible that the call to shutdown will raise a BlockingIOError, and if so, under what conditions? I've not experienced it happening, but this (of course) doesn't mean it can't happen.

1

1 Answers

1
votes

According to POSIX and Linux documentation, shutdown cannot return EWOULDBLOCK or equivalent error. The asyncio library consequently makes no provisions to handle such a result.

Although shutdown() transmits (meta-)data to the peer, you can think of shutdown as exiting immediately with the actual work being done by the OS behind the scenes. close() works in much the same way.