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