How to send data to peers over the net

  • Thread starter Thread starter Rotsey
  • Start date Start date
R

Rotsey

Hi,

I am writing a game that I want to net enable.

So I want to be able to connect to peers over the internet. I will
be sending very small packets of data.

What is the best way to do this?

Do I need a middle man server?

Can someone outline how to do it please?

rotsey
 
Hi,

I am writing a game that I want to net enable.

So I want to be able to connect to peers over the internet. I will
be sending very small packets of data.

What is the best way to do this?

Do I need a middle man server?

Can someone outline how to do it please?

rotsey

Depending on exactly what you are doing, you should be able to just
use TcpSockets to communicate between each other. I believe either the
VS Help or MSDN has some lengthy examples on this, so you might start
your research there.

The other option (as you suggested) is to use a "middle-man" server
that you both connect to. Doing this would allow you several options
such as an ASP.Net XML Web Service - but it would require you to have
an extra server.

Thanks,

Seth Rowe
 
Thanks Seth

With web services you can't send a peer a message without a request,
is that right?

So you have to loop in your client and keep requesting until the data is
returned???
 
Thanks Seth

With web services you can't send a peer a message without a request,
is that right?

So you have to loop in your client and keep requesting until the data is
returned???

Pretty much. Your best bet is probably to just go with the TcpSockets
approach - then you just configure a listener to grab any message. If
you need a high-performance option you could use the multiplayer part
of DirectX (can't remember it's name) - but it will be much harder to
configure and most examples will be in C++

Thanks,

Seth Rowe
 
Back
Top