views:

172

answers:

2
+1  Q: 

Multiplayer game

Using either XNA OR just the usual c# win forms application, which would be the best way to create the feature that enables text messages to be sent from me to my friend over the internet?

I don't know if this matters or not, but I now have 3 Mobile Broadband internet... so it's like... Wireless internet, does that matter?

+1  A: 

You could look into the Socket class or the simpler TcpClient and TcpListener. Whether XNA or Winforms shouldn't matter. Using XNA on the Windows platform gives you access to the entirety of the .NET framework, including the networking aspects.

Bob
+4  A: 

It is quite difficult to "reach your friend over the internet", whatever the framework.

Reaching someone's PC requires knowing the IP address of the destination PC. If the PC is behind a router, the PC most likely has a private IP address, thus is unreachable unless the router implements some form of forwarding (in which case a given TCP port is forwarded to a given PC's internal IP address). Then, you need to configure the router to use DDNS so that your code can get at the router's IP address.

So, it is possible (using the classes mentioned by @Bob), but not for the faint of heart.

The way professional programs (like chat clients) do it is to have a central server that relays messages. The code running on your PC and on your friend's PC sends messages to this server instead of directly to each other, so one doesn't need to know the IP address of the other one. But going this route requires some form of hosting for the server PC.

Timores