Perhaps Socket.shutdown() in std.socket should throw an exception in case of an error? Unlike close(), it may fail before you are done with the socket.<div>One may, for instance, want to wait for a confirmation message from the client after sending the FIN packet with shutdown(SocketShutdown.SEND). If the client disconnected, POSIX shutdown() can inform you with erro ENOTCONN.</div>