Esempio n. 1
0
            public DrawState(PinchGo parent)
            {
                _parent = parent;

                _smoothedPosition       = new SmoothedVector3();
                _smoothedPosition.delay = parent._smoothingDelay;
                _smoothedPosition.reset = true;
            }
Esempio n. 2
0
        public static void ReceiveCallback(IAsyncResult AR)
        {
            //Check how much bytes are recieved and call EndRecieve to finalize handshake
            int recieved = _clientSocket.EndReceive(AR);

            if (recieved <= 0)
            {
                return;
            }

            //Copy the recieved data into new buffer , to avoid null bytes
            byte[] recData = new byte[recieved];
            Buffer.BlockCopy(_recieveBuffer, 0, recData, 0, recieved);

            //Process data here the way you want , all your bytes will be stored in recData
            string _returndata = System.Text.Encoding.UTF8.GetString(recData);

            PinchGo.setText(_returndata);

            //Start receiving again
            _clientSocket.BeginReceive(_recieveBuffer, 0, _recieveBuffer.Length, SocketFlags.None, new AsyncCallback(ReceiveCallback), null);
        }