Ejemplo n.º 1
0
        public void TestCanConnectToAbly()
        {
            // Act
            bool result = AblyRealtime.CanConnectToAbly();

            Assert.True(result);
        }
 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);
     }
 }
 private static bool ShouldUseFallbackHost(ErrorInfo error)
 {
     return(error != null && error.StatusCode != null && FallbackReasons.Contains(error.StatusCode.Value) && AblyRealtime.CanConnectToAbly());
 }