testing for reconnection on socket error