コード例 #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;
        }