public override void OnTransportStateChanged(TransportStateInfo state) { if (state.State == TransportState.Closed) { this.TransitionState(new ConnectionClosedState(this.context)); } }
public override void OnTransportStateChanged(TransportStateInfo state) { if (state.State == TransportState.Closed) { this.context.SetState(new ConnectionDisconnectedState(this.context, state)); } }
private static ErrorInfo CreateError(TransportStateInfo state) { if (state != null && state.Error != null) { if (state.Error.Message == "HTTP/1.1 401 Unauthorized") { return(ErrorInfo.ReasonRefused); } } return(ErrorInfo.ReasonFailed); }
public override void OnTransportStateChanged(TransportStateInfo state) { if (state.Error != null || state.State == TransportState.Closed) { ConnectionState nextState; if (this.ShouldSuspend()) { nextState = new ConnectionSuspendedState(this.context); } else { nextState = new ConnectionDisconnectedState(this.context, state) { UseFallbackHost = state.Error != null && AblyRealtime.CanConnectToAbly() }; } this.TransitionState(nextState); } }
public abstract void OnTransportStateChanged(TransportStateInfo state);
public override void OnTransportStateChanged(TransportStateInfo state) { // could not happen }
private static ErrorInfo CreateError(TransportStateInfo state) { return(ErrorInfo.ReasonDisconnected); }
public ConnectionDisconnectedState(IConnectionContext context, TransportStateInfo stateInfo) : this(context, CreateError(stateInfo), new CountdownTimer()) { }
public ConnectionFailedState(IConnectionContext context, TransportStateInfo transportState) : base(context) { this.Error = CreateError(transportState); }
public override void OnTransportStateChanged(TransportStateInfo state) { // do nothing }