コード例 #1
0
        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            //instantiate sockets and get ip addresses.
            this.colorConnector = new AsyncNetworkConnectorServer(colorPort);
            this.depthConnector = new AsyncNetworkConnectorServer(depthPort);
            this.IRConnector    = new AsyncNetworkConnectorServer(IRPort);

            this.colorIPBox.Text = this.colorConnector.selfEndPoint.ToString();
            this.depthIPBox.Text = this.depthConnector.selfEndPoint.ToString();
            this.IRipBox.Text    = this.IRConnector.selfEndPoint.ToString();
            //Create the connections
            this.colorConnector.startListening();
            this.depthConnector.startListening();
            this.IRConnector.startListening();
        }
コード例 #2
0
 public void startListeningCallBack(IAsyncResult ar)
 {
     try
     {
         AsyncNetworkConnectorServer connector = (AsyncNetworkConnectorServer)ar.AsyncState;
         FlaggedSocket tempSocket = new FlaggedSocket();
         tempSocket.socket = (connector.listenerSocket.EndAccept(ar));
         connector.connectedClientList.Add(tempSocket);
         Console.WriteLine("Added socket to client list");
         connector.listenerSocket.BeginAccept(new AsyncCallback(startListeningCallBack), connector);
     }
     catch (Exception e)
     {
         Console.WriteLine("Error in startListeningCallBack: " + e.ToString());
     }
 }
コード例 #3
0
ファイル: MainWindow.xaml.cs プロジェクト: noa99kee/k2_server
        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            //instantiate sockets and get ip addresses.
            this.colorConnector = new AsyncNetworkConnectorServer(colorPort);
            this.depthConnector = new AsyncNetworkConnectorServer(depthPort);
            this.IRConnector = new AsyncNetworkConnectorServer(IRPort);

            this.colorIPBox.Text = this.colorConnector.selfEndPoint.ToString();
            this.depthIPBox.Text = this.depthConnector.selfEndPoint.ToString();
            this.IRipBox.Text = this.IRConnector.selfEndPoint.ToString();
            //Create the connections
            this.colorConnector.startListening();
            this.depthConnector.startListening();
            this.IRConnector.startListening();
        }