internal virtual void OnError(IConnection connection, Exception exception)
{
TransportFailed(exception);
_reconnectInvoker.Invoke();
if (!TransportHelper.VerifyLastActive(connection))
{
StopPolling();
}
// Transition into reconnecting state
connection.EnsureReconnecting();
// Sometimes a connection might have been closed by the server before we get to write anything
// so just try again and raise OnError.
if (!ExceptionHelper.IsRequestAborted(exception) && !(exception is IOException))
{
connection.OnError(exception);
}
}