Rename socket.error to OSError.
Server shutdown management.