locked
It takes more than 10 seconds to bring up 2nd TCP connection after Wifi-direct Proximity connection is established

    Question

  • In my test with the Proximity sample app, it first establishes P2P connection using Proximity Wifi-direct. After the P2P connection is established, it tries to bring up 2nd TCP connection. But it takes more than 10s for the 2nd connection to be created. Is this by desing or is it a bug? Thanks.

          async void PeerFinder_Connect(object sender, RoutedEventArgs e)
            {
                rootPage.NotifyUser("", NotifyType.ErrorMessage);
                PeerInformation peerToConnect = null;
                try
                {
                    // If nothing is selected, select the first peer
                    if (PeerFinder_FoundPeersList.SelectedIndex == -1)
                    {
                        peerToConnect = _peerInformationList[0];
                    }
                    else
                    {
                        peerToConnect = _peerInformationList[PeerFinder_FoundPeersList.SelectedIndex];
                    }

                    rootPage.NotifyUser("Connecting to " + peerToConnect.DisplayName + "....", NotifyType.StatusMessage);
                    StreamSocket socket = await PeerFinder.ConnectAsync(peerToConnect);
                    rootPage.NotifyUser("Connection succeeded", NotifyType.StatusMessage);
                    PeerFinder_StartSendReceive(socket);

                    await _mySocket.ConnectAsync(socket.Information.RemoteHostName, "9957");
                    int i = 0;
                }
                catch (Exception err)
                {
                    rootPage.NotifyUser("Connection to " + peerToConnect.DisplayName + " failed: " + err.Message, NotifyType.ErrorMessage);
                }
            }

    Monday, October 1, 2012 5:04 PM

All replies