Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a socket server on WP7

I'm working on my multiplayer game for wp7. At this moment i successfully implemented the multiplayer game on Udp on UdpMultiCastClient. Well, without the phone itself i cannot test it, but from other various site(SO included) it seems UDP packet won't cross over outside of the router. So I wanted to implement a TCP P2P, so each game client connects to everyone else, so data wont be proxied through server. But the socket class on WP7 doesn't have Listen method, neither AcceptAsync. Is it normal?

like image 553
Łukasz Młynik Avatar asked Jun 13 '26 16:06

Łukasz Młynik


1 Answers

It unfortunately seems like you can't bind a WP7.5 socket to listen for incoming connection on a specific port. So the phone can't act as a server. This is really a shame. TCP P2P connections would be awesome.

Hopefully this will be implemented into next version of Windows Phone. Meanwhile the easiest solution is probably to use a server in the middle which both devices connect to.

Edit: Socket Listeners is available in WP8.1 ...

https://msdn.microsoft.com/en-us/library/windows/apps/hh202858(v=vs.105).aspx https://msdn.microsoft.com/en-us/library/windows/apps/hh202874(v=vs.105).aspx

like image 75
mattsson Avatar answered Jun 16 '26 20:06

mattsson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!