简体   繁体   中英

Two-way communication on Windows Phone 7

I should make an application for Windows Phone 7.5, which is able to communicate bidirectionally with the same application installed on other devices with the same operating system.

I read that the Silverlight version on Windows Phone only supports BasicHttpBinding, so I think I will have to implement bi-directional mode using the BasicHttpBinding: for example, the node that accepts the incoming "connection" could send a GUID to the requesting node in order to identify a kind of session (this GUID should then be sent for each subsequent communication between two nodes).

Are there better alternatives?

The core of all communication is communication between two nodes:

  • there are three types of requests (one of these must be very frequently, say every 10 seconds);
  • the node which receives a request, could answer or ignore the request.

What is the impact on performance?

I don't think there is a way to accept connections on WP7 devices, see here .

Since WP7 doesn't support poll duplex WCF services either, I recommend you manually implement it, similar to this: http://www.dominikschmidt.net/2010/12/windows-phone-7-callbacks-and-duplex-wcf/

You will need a central server which all clients continually post messages to. Every time a Client1 calls the server, it checks the database to see if Client2 sent Client1 a message. If so, that message is included in the response to Client1.

You probably need a relay service since it's unlikely you're going to have routable, stable communication directly between devices. For example the Project Hawaii Relay Service likely will provide what you want, or you could implement something that looks and acts a whole lot like it on your own server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM