Welcome! Log In Create A New Profile

Advanced

Making a Head-to-Head Online Game

Posted by Arikado 
Re: Making a Head-to-Head Online Game
January 09, 2009 09:33AM
ftpii (http://code.google.com/p/ftpii/) is a pretty good example; it uses non-blocking sockets instead of multi-threading for concurrency, though the earlier versions used threads (got rid of them around revision 74 IIRC). It has examples of both client and server code.
Re: Making a Head-to-Head Online Game
January 09, 2009 10:37AM
Oh yeah, I was looking at that too and it's a good example as well.

I also wanted to point out if you were looking at the guide on beej.us that I posted earlier, some of the functions in network.h are analogs of syscalls that he mentions in section 5, but they have net_ appended to the front, like net_socket(), net_bind(), etc.
Re: Making a Head-to-Head Online Game
January 09, 2009 08:53PM
lol, this makes me feel special.

Now I'm going to try to make my own network using project :)

going for the gold with an irc client!

probably won't be a sucess though

[cough]#wiidev[/cough] :p

err... I think I'll stop with the edits



Edited 3 time(s). Last edit at 01/09/2009 09:00PM by Matando.
Re: Making a Head-to-Head Online Game
January 09, 2009 09:37PM
This may help you Matando :)

[www.irchelp.org]
Re: Making a Head-to-Head Online Game
January 09, 2009 10:51PM
thanks
Re: Making a Head-to-Head Online Game
March 06, 2009 08:10AM
Hi,
I see you write in c++. I'm actually working on an network class, which will abstruct all this things.
At the moment I'm working on the listen mode, it's the only thing which is not working yet. I have also to do some documentation. But I'll make ready a package with the source, a doxygen dokumentation and an example. Its using threads so it dont have to block and you can things in background.
There have also some workaround to handle the all the data, but the interface is ready.
If you are interessted reply here.

greetings
Re: Making a Head-to-Head Online Game
March 06, 2009 08:21AM
Hi lolme - welcome.

I wrote a class to do network communications without threads. If you look up the WiiRadio project you'll find it under the source.

If your planning a threaded class beware that libogc threads are not as forgiving as pthreads or windows threads. They are very temperamental. I posted a question about this named "threads" on this forum and got some great advice from some guy's who have been using libogc threads for a while.
Re: Making a Head-to-Head Online Game
March 06, 2009 08:59AM
Thanks for your info.
I will search about it. But if you want to take a look what if done here is a link to the documentation:
http://blub-web.net/projekt/wiisock/html/index.html



Edited 1 time(s). Last edit at 03/06/2009 09:01AM by lolme.
Re: Making a Head-to-Head Online Game
March 06, 2009 05:04PM
I have only one thing to add:
Never forget that TCP is a stream protocol. This means that you can not assume anything about how the data is received. Buffer everything you have read until you know that you have a full logical unit of data, and don't forget that the buffer might just have more than unit of data in it.
For ways to know when a logical unit of data is done, there is three main strategies:
    [*]Use known length units.
    [*]State the length in the header of the unit.
    [*]Use a delimiter, such as a newline.
Sorry, only registered users may post in this forum.

Click here to login