fix for socket IOError
fix for reconnection to downstrem hangup