Exemple #1
0
        private void checkStateChange()
        {
            int currentState = API_ERROR;
            int count;
            int output;



#if (POLLING)
            {
                currentState = getApiStateFromEvents();
                if (previousState == API_SUSPENDED && currentState == API_READY)
                {
                    currentState = API_RESUME;
                    printAPIState(currentState);
                    previousState = API_READY;
                    return;
                }
            }
#else
            {
                currentState = getApiStateFromEventsWithResume();
            }
#endif
            if ((currentState != API_ERROR) && (currentState != previousState))
            {
                switch (currentState)
                {
                case API_READY:
                    #region Connected
                    if (IsConnected)
                    {
                        client_Connect();
                        if (Listenercount > 0)
                        {
                            for (count = 1; count <= Listenercount; count++)
                            {
                                output = CallBackHandler.beginSabreTrafficListener_stdcall(Convert.ToInt32(MESSAGE_TYPE), cb);
                            }
                        }
                    }
                    else
                    {
                        client_Connect();
                        begin_SabreTrafficListener();
                        LoadCommandsRestricted();
                        CheckConnection();
                    }
                    break;

                    #endregion
                case API_UNAVAILABLE:
                    IsSigned    = false;
                    IsConnected = false;
                    CloseObjects();
                    break;
                }
                previousState = currentState;
            }
        }
 public CommandsAPI()
 {
     try
     {
         cbCustom = new CallBackHandler.MySabreCallback(CustomDelegate);
         long output = CallBackHandler.beginSabreTrafficListener_stdcall(Convert.ToInt32(MESSAGE_TYPE), cbCustom);
     }
     catch (Exception EX)
     {
     }
 }
Exemple #3
0
        private void begin_SabreTrafficListener()
        {
            try
            {
                long output = CallBackHandler.beginSabreTrafficListener_stdcall(Convert.ToInt32(MESSAGE_TYPE), cb);

                if (output.Equals(0))
                {
                    //Listenercount += 1;
                }
            }
            catch
            {
            }
        }