예제 #1
0
파일: Apollo.cs 프로젝트: h2oz/AlloHouston
        // Stop the connection with Apollo when the program shuts down
        public void OnApplicationQuit()
        {
            // stop the tcp client
            ApolloTCP.StopClient();

            // stop the apollo checking coroutine
            StopAllCoroutines();
            running = false;
        }
예제 #2
0
파일: Apollo.cs 프로젝트: h2oz/AlloHouston
        // Called when a fail message is returned from Apollo
        private static void failHandler(IntPtr cbr, UInt64 session, UInt16 eventID, string failMsg)
        {
            warning("Fail(" + eventID + "," + eventList[eventID].type + "): " + failMsg);
            // This event is handled (failed) so remove from the eventList if it exists
            if (eventList.ContainsKey(eventID))
            {
                eventList.Remove(eventID);
            }

            // Restart client if it failed to setup raw/data streams
            ApolloTCP.StopClient();
        }
예제 #3
0
파일: Apollo.cs 프로젝트: h2oz/AlloHouston
        void Start()
        {
            CreateApolloSession();

            // initialise the TCP client connecting to Apollo
            _apolloTCP = new ApolloTCP(receivePacket, _ip, _port);

            // Try to start Apollo
            StartCoroutine(StartApollo(2));

            // start periodic check for the Apollo connection and state
            _apolloCheck = StartCoroutine(ApolloCheck());
        }
예제 #4
0
파일: Apollo.cs 프로젝트: h2oz/AlloHouston
        // Reset every variable related to connecting with Apollo
        private void resetApolloState()
        {
            apolloState = ApolloState.APOLLO_0_CONNECTING;
            // empty the source and event List
            sourceList.Clear();
            eventList.Clear();

            // reset the apollo session
            ApolloSDK.apolloCloseSession(_session);
            CreateApolloSession();

            // make sure the TCP server is reset
            ApolloTCP.StopClient();

            _connectionAttempts = 0;
        }