fix the bug: socket close while the conn is open