Esempio n. 1
0
 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);
     }
 }
Esempio n. 5
0
 public abstract void OnTransportStateChanged(TransportStateInfo state);
 public override void OnTransportStateChanged(TransportStateInfo state)
 {
     // could not happen
 }
Esempio n. 7
0
 private static ErrorInfo CreateError(TransportStateInfo state)
 {
     return(ErrorInfo.ReasonDisconnected);
 }
Esempio n. 8
0
 public ConnectionDisconnectedState(IConnectionContext context, TransportStateInfo stateInfo) :
     this(context, CreateError(stateInfo), new CountdownTimer())
 {
 }
 public ConnectionFailedState(IConnectionContext context, TransportStateInfo transportState) :
     base(context)
 {
     this.Error = CreateError(transportState);
 }
Esempio n. 10
0
 public override void OnTransportStateChanged(TransportStateInfo state)
 {
     // do nothing
 }