https://docs.python.org/3/howto/sockets.html#socket-howto
suggests (via the MySocket.mysend example in the section "Using a Socket") that send on a socket closed by the remote end returns 0 to indicate the disconnection.
On my system (Linux 5.4, Python 3.10), socket.send does not return 0 in this
case but raises OSError(EPIPE) instead.
Linked PRs