Andreas Zita
Andreas Zita

Reputation: 7560

Sockets in Windows Phone 7 works fine in emulator but not on the phone

Im trying out the new additions of Socket-communication (TCP & UDP) in the Beta 2 refresh of Mango for Windows Phone 7.

The problem I have is that it behave differently on the emulator and on the actual phone (Samsung Omnia 7).

First I have tried UDP for several days now but with a lot of performance problems. I get very bursty sending of UDP-messages which has left me clueless.

Now Im trying TCP but here I get other problems instead. Firstly, I always instantly get a SocketResult of "Success" when running on the phone (ConnectAsync), no matter if the server is up or not. When running on the emulator I get "Connection Refused" which is more expected when there is no server running. When having the server online I first get "Success" and then "Connection Reset" when trying to use the connection. The server never gets past Accept. When running on the emulator everything works as expected.

Why is this? I know Mango is still in a Beta-release but could it be something Im missing here? I suspect my code is ok since it works fine in emulator mode. Ive tried turning off the Windows 7-firewall but that didnt do any good.

Im using a Samsung Omnia 7 with the Beta 2 refresh of Mango (7.10.7712.60). The Phone is connected and Zune is running. Do I need to upgrade any firmware as well?

Upvotes: 3

Views: 1272

Answers (1)

Claus Jørgensen
Claus Jørgensen

Reputation: 26344

Testing with Zune is rarely a good idea, as it have some networking issues. Instead consider using WPConnect.exe (found in C:\Program Files\Microsoft SDKs\Windows Phone\v7.1\Tools\WPConnect).

Also, always test without a cable attached, to see how the phone reacts itself.

Upvotes: 1

Related Questions