Sign in to follow this  
KeLi

I want the easiest + quickest way to send data.

Recommended Posts

KeLi    116
Hi ! I'm new at Multiplayer programming, and I have looked all over the internet for easy ways to send data between computers. I can't find any good tutorials or examples that makes me understand. I only find the same tutorial for DPlay on every site, taken from this page. I just want to send simple data between computers. More than 2 computers. Anyone got any ideas what I should use? Should I use DirectPlay? If that's the case, could anyone help me with some samples or tutorials? Thank you ! KeLi.

Share this post


Link to post
Share on other sites
falkone    444
Not at all, you can have multiple sockets open. I would probably use UDP, which allows you to recieve and send without making a TCP 'connection' each time.. this will simplify things with multiple machines.

Share this post


Link to post
Share on other sites
Palidine    1315
i'd concur with the winsock suggestion. one of the better things about learning winsock is that the syntax is almost identical to the libraries you use for *nix. if you make clean enough base code it's really easy to port your app.

-me

Share this post


Link to post
Share on other sites
Palidine    1315
[google]: "winsock udp tutorial"

is a nice place to start. try throwing in your language of choice as a search string for better results. i find "winsock tutorial" to give better results. the difference between sending TCP and UDP data is a single argument in an init function. everything else is the same, so don't stress about TCP v UDP quite yet. and certainly don't make the decision to use one or another until you understand what each is and what their respective costs and benefits are. generally you'll use a mix of both for a standard multiplayer game.

the key words for TCP & UDP:

TCP: slower / reliable (every packet will be delivered)
UDP: faster / unreliable (not every packet will be delivered)

-me

Share this post


Link to post
Share on other sites
k_rad    122
Well I've not spent any time doing game programming (yet), but I certainly know that I use sockets when sending anything between PC's. However I'm a low-level C coder...so I'm sure by now there is some crazy ass Direct-X call to do that all for you...

But for some info on low-level socket programming:

http://www.ecst.csuchico.edu/~beej/guide/net/html/
and
http://www.uwo.ca/its/doc/courses/notes/socket/

It's really quite easy, and you also don't concern yourself with the underlying data structures...just send over the raw data.

Works just like writing to a file, because well, it essentially is.

Share this post


Link to post
Share on other sites
KeLi    116
I'm now using winsocks, seems easy enough. Just wondering, how can I get the state of a socket? I use a listen socket, and a client connects, sends some data, then the client application quits. And when I try to connect again, the data sent is not recieved by the server.

Share this post


Link to post
Share on other sites
Niruth    122
DirectPlay is one of the best network API, it's easy to use if you know the way to write it.. Try this eBook, www.deersoftware.com/ebook.php

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this