|
|
| Networking in C (libnet, enet): Advice? |
|
Jimage
Member #4,205
January 2004
|
I've finally decided to tackle network programming, and would prefer to keep with C rather than hybridise into C++ with the likes of Zoidcom and those other (otherwise very nice sounding) libraries I've been reading about, and also keep cross-platform support. Using these criteria, it looks like my two choices are libnet and enet. (If there are any others, do let me know). However, their support is limited, so I'm hoping some of you folks who have some experience with them can help me out with the troubles I am facing. I'll start with libnet. Firstly, there's a matter of versions. The latest available on the site seems to be 0.10.11, but when I run make with mingw, I'm presented with the following error: Quote:
drivers/internet.c: In function `do_init_channel': What's the best way to go about fixing this? I'm also playing around with libnet under Linux, and installed version 1.1.2.1 from the Arch repository, but upon using the examples in the Pixelate 7 tutorial and the linked How-To, errors occur saying that net_drivers_all, NET_DRIVERLIST and NET_DRIVERNAME don't exist. I remember reading somewhere about various details changing across some of the 1.x releases--where can the specifics of this be found? The 1.1.2.1 documentation doesn't seem to cover this. Assuming I get that going, can anyone explain how I go about making that version work in Windows? I've got a source copy here, but the makefiles don't work. As for enet... it installed nicely to my Linux machine, but I'm yet to try it out. I don't know how to get it to compile in Windows yet, so some help with that would be appreciated. Thanks for reading.:) |
|
Myrdos
Member #1,772
December 2001
|
There's also HawkNL, which I believe is implemented in C. __________________________________________________ |
|
Todd Cope
Member #998
November 2000
|
I use HawkNL. It is pretty basic but it works in Linux and Windows. |
|
Evert
Member #794
November 2000
|
I think the Linux libnet library you tried is a different library with the same name. The version on libnet's site is the lastest (and last?) version. I don't recall having problems with libnet in Windows but it's been a while since I've tried it. I did clean up the code a bit for one of my projects, so maybe it's something I ran into originally and fixed. |
|
Jimage
Member #4,205
January 2004
|
David McCallum said: There's also HawkNL, which I believe is implemented in C. Ah, nice! I have come across that, but somehow dismissed it. I'll give it a whirl. Evert said: I think the Linux libnet library you tried is a different library with the same name. That explains a lot. Cheers. Hmm, make seems to be reporting the same problems compiling 0.10.11 under Linux. Evert said: I did clean up the code a bit for one of my projects, so maybe it's something I ran into originally and fixed. Do you happen to have the modified version handy? Thanks for the help. |
|
Evert
Member #794
November 2000
|
Quote: Do you happen to have the modified version handy? Here: http://www.allegro.cc/forums/thread/582963/583232#target |
|
Jimage
Member #4,205
January 2004
|
Sweet. Got that to compile in both Linux and Windows. When next I regain consciousness, I shall experiment! |
|
James Stanley
Member #7,275
May 2006
|
If you want to use plain sockets, Beej's guide is all you need. I can definitely recommend it as a useful thing to learn. |
|
aj5555
Member #9,033
September 2007
|
i learned socket programming on windows from a 10 line example on msdn. it works. its simple. most of these library are just confusing wrappers around something that is already been simplified by the OS's API. |
|
|