<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Networking in C (libnet, enet): Advice?</title>
		<link>http://www.allegro.cc/forums/view/594262</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sat, 08 Dec 2007 11:11:22 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;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&#39;ve been reading about, and also keep cross-platform support.</p><p>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&#39;m hoping some of you folks who have some experience with them can help me out with the troubles I am facing.</p><p>I&#39;ll start with libnet. Firstly, there&#39;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&#39;m presented with the following error:</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
drivers/internet.c: In function `do_init_channel&#39;:<br />drivers/internet.c:116: warning: dereferencing type-punned pointer will break strict-aliasing rules<br />make[1]: *** [drivers/internet.o] Error 1<br />make[1]: Leaving directory `E:/Software/Libraries/libnet-0.10.11/libnet/lib&#39;<br />make: *** [lib] Error 2
</p></div></div><p>

What&#39;s the best way to go about fixing this?</p><p>I&#39;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&#39;t exist.</p><p>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&#39;t seem to cover this. Assuming I get that going, can anyone explain how I go about making that version work in Windows? I&#39;ve got a source copy here, but the makefiles don&#39;t work.</p><p>As for enet... it installed nicely to my Linux machine, but I&#39;m yet to try it out. I don&#39;t know how to get it to compile in Windows yet, so some help with that would be appreciated.</p><p>Thanks for reading.:)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Jimage)</author>
		<pubDate>Tue, 04 Dec 2007 18:15:30 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>There&#39;s also <a href="http://www.hawksoft.com/hawknl/">HawkNL</a>, which I believe is implemented in C.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Myrdos)</author>
		<pubDate>Wed, 05 Dec 2007 03:39:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I use <a href="http://www.hawksoft.com/hawknl/">HawkNL</a>. It is pretty basic but it works in Linux and Windows.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Todd Cope)</author>
		<pubDate>Wed, 05 Dec 2007 03:45:18 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I think the Linux libnet library you tried is a different library with the same name. The version on libnet&#39;s site is the lastest (and last?) version.</p><p>I don&#39;t recall having problems with libnet in Windows but it&#39;s been a while since I&#39;ve tried it. I did clean up the code a bit for one of my projects, so maybe it&#39;s something I ran into originally and fixed.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Wed, 05 Dec 2007 05:38:26 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">David McCallum said:</div><div class="quote"><p>
There&#39;s also HawkNL, which I believe is implemented in C.
</p></div></div><p>
Ah, nice! I have come across that, but somehow dismissed it. I&#39;ll give it a whirl.</p><div class="quote_container"><div class="title">Evert said:</div><div class="quote"><p>
I think the Linux libnet library you tried is a different library with the same name.
</p></div></div><p>
That explains a lot. Cheers.</p><p>Hmm, make seems to be reporting the same problems compiling 0.10.11 under Linux.</p><div class="quote_container"><div class="title">Evert said:</div><div class="quote"><p>
I did clean up the code a bit for one of my projects, so maybe it&#39;s something I ran into originally and fixed.
</p></div></div><p>
Do you happen to have the modified version handy?</p><p>Thanks for the help.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Jimage)</author>
		<pubDate>Wed, 05 Dec 2007 11:55:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Do you happen to have the modified version handy?
</p></div></div><p>
Here: <a href="http://www.allegro.cc/forums/thread/582963/583232#target">http://www.allegro.cc/forums/thread/582963/583232#target</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Wed, 05 Dec 2007 14:37:18 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Sweet. Got that to compile in both Linux and Windows. When next I regain consciousness, I shall experiment!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Jimage)</author>
		<pubDate>Wed, 05 Dec 2007 19:18:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If you want to use plain sockets, Beej&#39;s guide is all you need. I can definitely recommend it as a useful thing to learn.<br /><a href="http://www.beej.us/guide/bgnet/">It&#39;s here</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (James Stanley)</author>
		<pubDate>Fri, 07 Dec 2007 19:41:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>i learned socket programming on windows from a 10 line example on msdn.  it works.  its simple.  </p><p>most of these library are just confusing wrappers around something that is already been simplified by the OS&#39;s API.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (aj5555)</author>
		<pubDate>Sat, 08 Dec 2007 11:11:22 +0000</pubDate>
	</item>
</rss>
