Example #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();
        }
Example #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());
     }
 }
Example #3
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();
        }