Disconnecting underlying socket given there is a connection error when receiving