private void InitTracking()
        {
            if (_client != null && _client.isConnected())
            {
                Debug.LogWarning("Client is already connected. Abort opening another connection.");
                return;
            }

            _eventQueue = new Queue <TuioEvent>();

            // Create a new TUIO client and listen for data on the specified port
            _client = new TuioClient(_udpPort);
            _client.addTuioListener(this);
            _client.connect();

            if (!_client.isConnected())
            {
                Debug.LogError("Couldn't listen at port " + _udpPort + " for TUIO data. Check if port isn't already in use. (netstat -ano | find \"" + _udpPort + "\")\n(also be sure to kill adb.exe if its still running)");
                _client.removeTuioListener(this);
                _client = null;
            }
            else
            {
                Debug.Log("Connection establised: listening at port " + _udpPort + " for TUIO data.");
            }
        }
        private void InitTracking()
        {
            while (m_client != null && m_client.isConnected())
            {
                Debug.LogWarning("Client still connecting. Waiting...");
            }

            m_eventQueue = new Queue <TuioEvent>();
            // Create a new TUIO client and listen for data on the specified port
            m_client = new TuioClient(m_udpPort);
            m_client.addTuioListener(this);
            m_client.connect();
            if (!m_client.isConnected())
            {
                Debug.LogError("Couldn't listen at port " + m_udpPort + " for TUIO data. Check if port isn't already in use. (netstat -ano | find \"" + m_udpPort + "\")\n(also be sure to kill adb.exe if its still running)");
                m_client.removeTuioListener(this);
                m_client = null;
            }
            else
            {
                //Debug.Log ("--- Connection establised: listening at port " + m_udpPort + " for TUIO data. ---");
            }
        }
Example #3
0
 public bool isConnected()
 {
     return(client.isConnected());
 }