Windows phone 8 socket listen




















Active Oldest Votes. Improve this answer. Brian P. Hamachek Brian P. Hamachek 7 7 silver badges 17 17 bronze badges. Francisco Aguilera Francisco Aguilera 3, 6 6 gold badges 25 25 silver badges 50 50 bronze badges.

Viral Viral 1 1 silver badge 6 6 bronze badges. Csharpz Csharpz 4 4 gold badges 15 15 silver badges 25 25 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science. The display name only applicable for the Bluetooth method.

Why this is only 15 characters — your guess is as good as mine. That is up to your app. But anyway — back up a little. ConnectAsync peerInformation.

You have a connection to the phone you have selected. But as you made the connection, the PeerFinder fired the ConnectionRequested event. Well guess what, part of the payload of the arguments of that event method gets is a PeerInformation object as well , containing the information to connect back to the phone that just connected to you We know have a two-way socket connection using Bluetooth and we can call the SendMessage method just like before, and listen to result by subscribing to MessageReceived event.

State, but just for args itself. This was necessary to be able to fire connect events from DoConnect. My apps check the SupportsTap and SupportsBrowse properties. If is not supported, I offer only Bluetooth. Completed comes by Call SendMessage — and see them appear in the method subscribed to MessageReceived on the other phone.

Browse and a display name Wait until a PeersFound event comes by Select a peer to connect to in your app Call the Connect method with the selected peer Wait until a TriggeredConnectState. Clear ; args. ForEach Peers. Add ; if Peers. Let's go in order: Does the above code work? You said you fixed the "Invalid argument exception" problem however my guess is that it still doesn't work as expected, this for the reasons in the next points You cannot "listen" on a socket on Windows Phone 7, for security reasons you can only receive from an IP you initiated a communication with, so send first an empty packet and then listen for a limited amount of time.

I hope the above three points sum up the main issues with your code. Improve this answer. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown.

The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back Featured on Meta.



0コメント

  • 1000 / 1000