[ENet-discuss] adapting enet to include tcp

Lee Salzman lsalzman1 at cox.net
Mon Jan 29 03:23:00 PST 2007


I had generalized the enet_socket_* functions so that you can create TCP 
sockets for certain uses (like making HTTP connections and such), but I 
don't think it'd be a good idea to use TCP as the underlying protocol 
for the rest of ENet. Most of ENet is just implementing features that 
TCP already has, although in a more flexible way. But on top of TCP, 
this is just not really possible or expedient. UDP is necessary for the 
lower latencies and packet control.

It's not that hard to take the enet_socket_* functions and write some 
simple client management code, so I opt to leave that functionality out 
of the library. It's just not in ENet's charter.

I want to keep ENet simple and good at what it does: KISS. This is what 
separates it from the other network libraries out there: it's very 
simple (code-wise) and unencumbered (license-wise), yet still fills a 
niche that did not exist before it was written.

Lee

Davin Gibb wrote:
> Hi all, I know this might seem like a stupid question, but hear me  
> out. I liked the abstraction enet has separating the platform  
> specifics from the developer, and had wondered, whether there had  
> been any moves to use enet for tcp sockets.
> 
> I've looked through the cvs snapshot, and indeed do see some  
> evidence, that someone somewhere had thought about this. Ideally  
> passing a flag at socket create to chose between the two (dgram or  
> stream), and then use enet_host_service like you would normally.  
> Since enet_host_service() kicks off a lot of the value add features  
> over generic udp sockets, possibly a big if statement to block out  
> all that stuff if the socket is of type stream.
> 
> Anyway in my head i know where i'd like to start and i'm happy to do  
> this, as i think for my use i do have a few reasons why i'd like to  
> stick with bread and butter tcp, and yet use enet's udp sockets on  
> the same host for different clients. But since i saw some evidence in  
> the code that someone had thought about this, I wanted to check in  
> case i was embarking on something redundant.
> 
> Lastly i did go through the archives and hadn't seen much on this  
> topic. Thanks in advance, Davin.



More information about the ENet-discuss mailing list