/*
         *  Assumption
         *  We assume that there is only one player
         */

        private static void addFrameAndCheckAction(int skeletonNo, Skeleton skeleton)
        {
            Frame newFrame = new Frame(skeleton, framesCount);

            int actionLabel = onlineDetector.addFrameAndCheckAction(newFrame);

            if (actionLabel != -1)
            {
                if (connectWithUnity)
                {
                    asyncClientSocket.sendData(Actions.getInstance().get2bytesID(actionLabel));
                }
                Console.WriteLine("Action Detected: " + actionLabel + ", " + Actions.getInstance().getActionName(actionLabel));
            }

            framesCount++;
        }
Esempio n. 2
0
    private void test()
    {
        AsynchronousClient asyncClient = new AsynchronousClient();

        if (asyncClient.canOpenSocketAndConnect())
        {
            // for (int i = 0; i < 2000; i++)
            //{
            for (int j = 0; j < 10; j++)
            {
                asyncClient.sendData(j + " ");// Bassem: takes 5 sec to complete
                // Bassem: this console write experess that the operation that we didn't wait 5 secs
                Console.WriteLine("sending " + j);
            }

            //}


            // receiveData();
            //asyncClient.closeSocket();
        }
    }