handle tcp socket closed