For those who don't know, enet is a simple network packet delivery system which offers garunteed delivery without the overhead of TCP. While TCP and enet provide the same basic functionality, the enet protocol is better for games in that the data being transfered is a bit lighter and more streamlined, thus allowing more packets to be delivered in a given timeframe.
Anyway, this is a simple sample showing connecting a client to a server and exchanging some simple information. In this case a text message each way. The client prompts the user for the text to send to the server and the server responds with a pre-formulated string and a random number.
http://ecowles.dyndns.org/download.php? ... xample.rar
Note: The provided executable is a Win32 executable which will attempt to contact my server. My server will be left running until I end up shutting it down or it crashes, which-ever comes first. You can rebuild the client/server for linux but you need to build enet for linux (http://enet.cubik.org/). There is no DOS port [period].
Simple enet server/client
You'd be right about telnet, and TCP in general, TCP apps will not work with enet, neither will straight UDP apps.Enet is pretty well only compatible with enet, much like SDL_net is only compatible with SDL_net (I was incorrect, apparently SDL_net is fully TCP/IP and UDP compliant).telnet uses TCP I believe which enet is not compatable with. enet is it's own protocol and can only communicate via enet.
Oh, and I changed my server to send verses from a song. Much amusement to be had!
Your also right about the amusement to be had from your server. Though I'm not sure of the song, banana ping pong certainly has much amusement.
Last edited by arenth on Sep 22, 2006 17:15, edited 1 time in total.
arenth, what I meant was that telnet uses TCP and not UDP. Theoretically if it used UDP, you could write a packet driver for telnet to use the enet protocol but, it doesn't so you can't.
Also, rebuilt and have the client/server using the release build of enet.
The lyrics are from the song "Banana Phone." It's quite an amusing song.
http://en.wikipedia.org/wiki/Bananaphone
The last link in the "External links" section is a HL2 animation with the original CD music. Very funny.
Also, rebuilt and have the client/server using the release build of enet.
The lyrics are from the song "Banana Phone." It's quite an amusing song.
http://en.wikipedia.org/wiki/Bananaphone
The last link in the "External links" section is a HL2 animation with the original CD music. Very funny.
Re: Simple enet server/client
if anyone has a copy of enet_example.rar, please share.