Example #1
0
        // 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;
        }
Example #2
0
        // 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();
        }
Example #3
0
        // 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;
        }