The Network.Socket.close claims that
All future operations on the socket object will fail
It changes socket state to Closed and calls close(2) C function, so OS is free to reuse the FD.
But Network.Socket.send and friends don't check socket status. When sending data to a closed socket usually an exception is thrown (close(2) returns EBADF), but there is a chance that the FD is reused after close but before send, so the data will be silently sent to a wrong destination.
One can argue that writing to a closed socket is a bad practice anyway, then please consider it as a documentation bug.
The
Network.Socket.closeclaims thatIt changes socket state to
Closedand callsclose(2)C function, so OS is free to reuse the FD.But
Network.Socket.sendand friends don't check socket status. When sending data to a closed socket usually an exception is thrown (close(2)returnsEBADF), but there is a chance that the FD is reused afterclosebut beforesend, so the data will be silently sent to a wrong destination.One can argue that writing to a closed socket is a bad practice anyway, then please consider it as a documentation bug.