fixed a bug that left sockets in the CLOSE_WAIT state