Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Suggestions for simple networking library

This thread is locked; no one can reply to it. rss feed Print
Suggestions for simple networking library
Joachim Arting
Member #13,584
September 2011

Hello everyone.

Next year I'll be working with a small business-project at school. I've been thinking about making some sort of 2D platformer with Allegro 5 supporting a simple co-op over LAN feature. Something like Lierox (http://www.openlierox.net/)

Now, is there any simple networking library that you would recommend? (Preferably with some kind of tutorial available)

Any advice would be much appreciated! :)

-------------------------------------------------------------------------------
"Men despise religion. They hate it and are afraid it may be true. The cure for this is first to show that religion is not contrary to reason, but worthy of reverence and respect. Next make it attractive, make good men wish it were true, and then show that it is." - Blaise Pascal

Hyena_
Member #8,852
July 2007
avatar

Could anyone explain me why one would even need something like Raknet? I have tried to use it several times but failed and still don't know what it has to offer. I have been using standard libraries for tcp/ip so far and they work well. If I had to use UDP I would just use sys/socket.h or winsock.h.

Joachim Arting
Member #13,584
September 2011

I'm sorry, I don't have any knowledge about any network programming. Can you point me towards a tutorial or something?

By the way, whats "Raknet"? ;D

-------------------------------------------------------------------------------
"Men despise religion. They hate it and are afraid it may be true. The cure for this is first to show that religion is not contrary to reason, but worthy of reverence and respect. Next make it attractive, make good men wish it were true, and then show that it is." - Blaise Pascal

m c
Member #5,337
December 2004
avatar

1) OLX is great. The original Liero was the first game that I made total conversions for.
2) Raknet is a library that handles networking for you. HawkNL and zoidcom are others, I have never used any of them.
3) Do a google search for beej, it is basically the nehe tutorials of unix socket programming (very apt actually as they are both out of date).
4) It isn't hard to learn this stuff yourself, no one else had ever done network programming before either until they did it, then they knew what was up. So go do it.
5) MSDN is another good resource, also the windows SDKs have succint example code ranging from simple to more complex that cover many different forms of networking (it is where I learned how to do IO completion port programming, by hacking, restructuring and simplifying their version. After about 2 weeks and 2 rewrites, I learned so much that I went back and re-wrote my kqueue code and made that better too).

(\ /)
(O.o)
(> <)

Joachim Arting
Member #13,584
September 2011

Thanks for your reply! :)
Which would you consider me to use? Raknet?

-------------------------------------------------------------------------------
"Men despise religion. They hate it and are afraid it may be true. The cure for this is first to show that religion is not contrary to reason, but worthy of reverence and respect. Next make it attractive, make good men wish it were true, and then show that it is." - Blaise Pascal

axilmar
Member #1,204
April 2001

Which would you consider me to use? Raknet?

Personally, I'd advise you not to use any networking library. Just use sockets (TCP/IP preferably with TCP_NODELAY to avoid buffering), and define your own communication protocol (i.e. set of messages) that suits your needs.

It is a lot easier than it sounds. You wouldn't need a lot of messages anyway.

jmasterx
Member #11,410
October 2009

I find enet nice. It's very simple and easy to use and abstracts the platform so you do not have to think about the slight differences between posix sockets and winsockets.

Joachim Arting
Member #13,584
September 2011

axilmar said:

Just use sockets (TCP/IP preferably with TCP_NODELAY to avoid buffering), and define your own communication protocol (i.e. set of messages) that suits your needs.

I'm sorry, but I don't really know anything about sockets. Is it in a library to be included?

-------------------------------------------------------------------------------
"Men despise religion. They hate it and are afraid it may be true. The cure for this is first to show that religion is not contrary to reason, but worthy of reverence and respect. Next make it attractive, make good men wish it were true, and then show that it is." - Blaise Pascal

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

I'm sorry, but I don't really know anything about sockets. Is it in a library to be included?

Use the Google, Luke. Look for 'Beej's guide to networking / sockets' and make yourself be informed. Once you understand sockets, get a library that does it for you, possibly from the ones recommended here. This question has been asked on the forums many times before, so a forum search wouldn't hurt either.

;)

Joachim Arting
Member #13,584
September 2011

This question has been asked on the forums many times before, so a forum search wouldn't hurt either.

Yeah... Guess I am abit lazy ;D

Will check it up, thanks!

EDIT: Ouch... This was alot to comprehend, I'm not sure I'm ready for this kind of programming :-/

-------------------------------------------------------------------------------
"Men despise religion. They hate it and are afraid it may be true. The cure for this is first to show that religion is not contrary to reason, but worthy of reverence and respect. Next make it attractive, make good men wish it were true, and then show that it is." - Blaise Pascal

Go to: