Пример #1
0
            public void StartClient()
            {
                try
                {
                    readNetworkStream = readClientSocket.GetStream();
                    server.updateServerMsg("Got read stream!");
                    sendNetworkStream = sendClientSocket.GetStream();
                    server.updateServerMsg("Got send stream!");


                    sendData("Welcome! Please send client type to get your client ID: ");
                    //updateKinectInfo("Connecting....");
                    byte[] buffer = new byte[readClientSocket.ReceiveBufferSize];
                    //WaitForRequest();//
                    readNetworkStream.BeginRead(buffer, 0, buffer.Length, ReadDataLengthCallback, buffer);
                }
                catch (Exception ex)
                {
                    updateKinectInfo("Connection failed!");
                    MessageBox.Show(ex.ToString());
                }
            }