Help on making the simplest sample

Started by
4 comments, last by ZippoLag 17 years, 9 months ago
Howdy there my friends, I'm quite new on this ciber-grounds, but it's been a while since I started to try and make games. Today I speak to you on the matter of learning how to make networked applications, and with this knowledge, to make a very small, simple, and well explained example of an aplication that can send a receive data, let's say.. a line of text. But.. I have found myself in some sort of dead end. You see, as most people I tought that I was just going to use DirectPlay, but I found out that it was declared deprecated, so on to winsock it was. I assumed that it was going to be as easy as learning any other thing, but.. for some reason I just can't figure it out! I've seen the sample program "Rock, Scissors, Paper.." and other stuff from the FAQ, I've also searched on the MSDN, and in a couple of more places, but I just can't get used to how it works.. Maybe it's just me, and after I'm done with the universite exams of the next 2 weeks I'll be able to see it.. But if not, I would reeeeeaaaaallyyy appretiate some help on this. What I want to make is an client-server aplication, it would do this: (after you start the server) "the clients requests and gets a connection to the server by typing the IP address. you tipe some text and send it trhu the server to all other clients. the received text is displayed on screen. clients can write as many times as they want. then they terminate their conection and the aplication exits." I think that the best and most useful way to show this would be with a simple console aplication, and using asychronous sockets, by passing messages like with the windows procedure. So.. I'm not asking to some of the most experticed members to write this for me, you see, I know well the theory, but somehow I fail to use it in practice.. So what I'm asking you people is just to help me make this in any way you can, and I'll add some final touches and useful comments inside the code so no one has to be in my position. Thanks in advance. ZippoLag.
Advertisement
google using combinations of keywords

client server TCP Source code sample c++ winsock

and you will find sample programs to do a simple client server.
this is something i found particularly useful

http://www.gamedev.net/reference/articles/article1674.asp

this guide includes both some theory and sample source code
Check out this CodeProject article and attached code.
oooohhhhhh myyyy gooooddness!!

Beej's guide it's simply beautiful!!
I'm actually kicking myself right now because I forgot to bring a diskette here and I can't take it home for a proper reading, I should just save some money and buy me a pen drive or an ipod..
ghak, I can't believe what a noob I am.. (I've just found kind of what I wanted to make on MSDN)

This topic is closed to new replies.

Advertisement