Don't close sockets twice