Message Board
Message Board > Fenix / Bennu / Gemix / DIV > [DLL] Network.DLL |
June 9, 2006, 01:27 | |
Sandman
F3n!x0r 1194 posts |
Introduction: Allright folks, here is another DLL: Network.dll. The origial NET.dll was annoying the crap out of me, so I made my own. Simple in use, just like Fiona was dreaming it. This DLL is for internet/network communication between two Fenix programs or a Fenix program and a different program. It handles quite a few things on its own, so the user can focus on different things in his program. Features: - One command setup, another one for listening for connections (server) or one for opening a connection (client). - Connection status monitor, informs Fenix of the status of the connections. - Sending and receiving of all variables, graphs, files, whatever you want. - Download/upload meter, for measuring of speeds and totals. - Automatic message seperation (seperation string specifiable). - Dynamic messagebuffer provides limitless sending and receiving. Future: - It probably will have UDP support as well, though at the moment only TCP is used. Download: So here's the complete package containing a simple testprogram with commented source, the DLL, the sourcecode and full documentation: Network.DLL v1.54a Network.DLL v1.54a for Fenix 0.83b Network.DLL v1.54a for Fenix 0.92a Network.DLL v1.55 for Bennu WIP8 and up Network.DLL v1.54a Tester Network.DLL v1.54a Example Log: 154a: Fixed a "debug assertion failed" error, when sending something, without having specified a separator. 154: Renamed all functions related to "seperator" to "separator". 153: Changed the about text in NET_About(). Changed some error codes, as they differed from the same, defined elsewhere. Added NET_SendGraph(), NET_RecvGraph(), NET_SendFile() and NET_RecvFile(). Added the optional parameter includeseperator to NET_Send(). When it is not 0, the connection's seperator will be added at the end of the to be sent data. When it is 0, it won't. Made messages unlimited. because in v1.5x this was more easy. NET_RECV() still has a limit of NET_MAX_MSG_LEN, but this is not a low number, so all should be well. If it's required, it is still possible to make that one unlimited as well. Added NET_ERROR_NULLPOINTER. Added NET_ERROR_NONEXISTINGGRAPH Added NET_ERROR_NONEXISTINGFILE Added NET_ERROR_CREATINGGRAPH Added NET_ERROR_OPENINGFILE Added NET_IntToIP() and NET_IPToInt(),which were previously made in Fenix Added errormessages for the new errorcodes in NET_GetError(). Added NET_SeperatorLength(); Fixed if other peer closes, this side does not notice until it tries to send a message. Moved the parameter includeseperator from NET_Seperator() to NET_Recv() and NET_RecvVar(). 152: Added comments, tidied up the code a little. Added and changed some console messages. Added the possibility of removing seperators. Added NET_DisconnectAll() and its synonym NET_CloseAll(). Added NET_IntVersion(). 151: Working. Celebrate! The most significant changes are the removal of the internal connections, the removal of NET_Send2() and NET_SendRN2() and the simplification of NET_Init(). Internally many things have changed, mostly for more efficiency. 150: Added/Fixed/Changed a lot of things, after half a year, in order to achieve working status again (I lost the sourcecode of v1.15 and up, due to a format). Some things might still not be completely in working order, but that will be sorted out as well in the future. 114: Fixed bug causing to send only to first 255 connections with NET_MessageRN(). Changed Fenix NET_MessageRN()'s name to NET_MessageRN2(). Added DLLside NET_MessageRN(). Renamed NET_Message3() to NET_Message2(). Added Global Vars NET.ActiveConnections and NET.ActiveListenConnections. Changed consolereports and returnnetdllcommands to pointers. Added NET_Hostname(). Added NET_Port(). Added NET_Resolve(). Added a check in NET_Disconnect() and NET_Accept() if (dis)connecting/disconnected hostname was found. Added NET_DUMInit(). Added various global variables for the DU Meter. Fixed some messaging functions not returning errorcodes. From now on the version will be 1.xx. 013: Added listenport to be optional ( 0<=listenport<=65535 is valid; 0 means undefined ). Changed NET_Listen() to be accessible from Fenix. Added in- and outMessageStacks. Added Message IDs and Message Codes. Changed hello-hallo bounce to be in opposite direction. Added parameter <numberoflistenports> to NET_Init(). Removed NET_GetPrevMessage() and NET_GetPrevPrevMessage(). Added optional parameter <messagesback> to NET_Message(). Added parameter <consolereports> to various functions. Added improvements to Internal/External behaviour. Added errorcodes. Added a new parser. Added parameter <returnnetdllmessages> to NET_DLLInit(); Anything else I did, like fixing the losses. 012: Fixed flooding when other peer disconnects. Fixed previous messages traces in current message. Added errorcodes. Added NET_Message2() and NET_Message3(). Fixed NET_Quit() now also kills the NET_Run(). Added NET_Run() as part of the NET_Init(). Changed name from NET.DLL to Network.DLL to avoid confusion. 011: Fixed some bugs and recoded parts of the core. Fixed message losses. Added the parameter <pingtimeout> to NET_Init(). 010: Released the DLL. Changed NET_Init() to NET_DLLInit(). 009: Made NET_Init() return an error if the maximum number of connections is wrong. 008: Added defines, made the returns return them and made more error checks. 007: Added Global Status Identifier 006: Improved Autodisconnect to first send a PING and only disconnect when PONG is not received. This will be improved to the PING and PONG having an identifier. This is to assure the PONG received is consequence of the PING, otherwise when last message is PONG and the other computer disconnects, the PONG message will be received over and over and it will not be disconnected. 005: removed bug: couldn't send more than 3 messages using NET_Message, though NET_Send worked fine. Fixed it by letting NET_Send return 0. 001- 004: Created main functions and so on. [Edited on September 30, 2008 by Sandman] ____________ BennuWiki Yes, my avatar has grey borders in IE (so get a decent browser) ROOFLEZ ROOFLEZ |
# |
June 9, 2006, 01:42 | |
Fiona
games are terrible -9616558 posts |
*GETS TO WORK*
____________ laffo |
# |
June 9, 2006, 02:10 | |
Woody
HEAD BLACK MAN 722 posts |
Momma this surely is a dream.
____________ boredome is the bitter fruit of too much routine |
# |
June 9, 2006, 16:16 | |
Rhovanion
Exterminated 666 posts |
Sounds neat, I'll download when I get to my project. If this forum had a reputation system I would surely have granted you some.
____________ |
# |
June 9, 2006, 18:04 | |
Eckolin
Quite Whiskered 388 posts |
NET_GetPrevPrevMessage( byte connection )?
____________ Maker of Games... Wisdom is supreme; therefore get wisdom. Need help with coding? I probably wrote something similar. |
# |
June 9, 2006, 18:09 | |
Sandman
F3n!x0r 1194 posts |
Quoting Eckolin: NET_GetPrevPrevMessage( byte connection )? It returns the message received before the previous received message. ____________ BennuWiki Yes, my avatar has grey borders in IE (so get a decent browser) ROOFLEZ ROOFLEZ |
# |
June 9, 2006, 23:10 | |
Rincewind
programmer 1548 posts |
Holy hell. You wrote that in two days? There's really nothing more appropiate to say than RESPECT. Surely your RTS won't be breaking down during online play like Tiberian Sun does then. :p I had a quick read through the readme, and it indeed looks very simple. NICE. I am going to use this. Is this DLL a wrapper for SDL networking (and thus compilable for Linux and Mac OS)? Oh and I like the hello - hallo bounce, and the multiple error messages for different errors. Just a thought, but perhaps it would be a good idea to give the dll another name so it won't be confused with the other net.dll? And uhm, how rare are 'rare message losses' exactly? ____________ Personal website: http://www.loijson.com |
# |
June 9, 2006, 23:16 | |
Fiona
games are terrible -9616558 posts |
Quoting Rincewind: Is this DLL a wrapper for SDL networking (and thus compilable for Linux and Mac OS)? Correct.Quoting Rincewind: Just a thought, but perhaps it would be a good idea to give the dll another name so it won't be confused with the other net.dll? And uhm, how rare are 'rare message losses' exactly? :P I had proposed ilovefiona.dll, but he opted for this boring name, and the message losses are almost all gone now. [Edited on June 9, 2006 by Fiona] ____________ laffo |
# |
June 10, 2006, 01:26 | |
Sandman
F3n!x0r 1194 posts |
Well actually it's not just a wrapper, it does a bit more, which will even be more and more in the future. But it should compile on Linux etc as well, yes. And I agree on the name, being prone to confusion, but it actually sucks calling it "net2.dll" because people without the knowledge of the first would be like "hmm" and I don't like being second! So if you have a proper other name... I'd prefer something in 3 chars or something that is abbreviated nicely to 3 chars. Maybe...Network Control System, or Network Communication System, or something else cheesy. And the message losses are now gone, I've updated to version 0.11. [Edited on June 10, 2006 by Sandman] ____________ BennuWiki Yes, my avatar has grey borders in IE (so get a decent browser) ROOFLEZ ROOFLEZ |
# |
June 10, 2006, 01:50 | |
Rincewind
programmer 1548 posts |
Abbreviations like those are ununderstable for normal humans unless they've been told what it means (like WPF). So I doubt that would help it's popularity. How about: network.dll connect.dll <--- PICK ME PICK ME internetwork.dll simple_net.dll traffic.dll These names are not too fancy, but they do speak for themselves and might spread very easily because of that. "Oh the network DLL? yeah let me see... network.dll!" Quote: And the message losses are now gone, I've updated to version 0.11. Awesome. ____________ Personal website: http://www.loijson.com |
# |
June 10, 2006, 02:14 | |
Woody
HEAD BLACK MAN 722 posts |
NETWERK.DLL
____________ boredome is the bitter fruit of too much routine |
# |
June 10, 2006, 02:29 | |
Fiona
games are terrible -9616558 posts |
I'm voting for ILF.DLL.
____________ laffo |
# |
June 10, 2006, 02:29 | |
Sandman
F3n!x0r 1194 posts |
It's that you are so persuasive, Rince. Network.DLL it is. [EDIT] Connect.DLL is not very nice to abbreviate and with Network.dll I can keep my current abbreviation. Yay. [Edited on June 10, 2006 by Sandman] ____________ BennuWiki Yes, my avatar has grey borders in IE (so get a decent browser) ROOFLEZ ROOFLEZ |
# |
June 10, 2006, 02:57 | |
Fiona
games are terrible -9616558 posts |
I wouldn't have minded CNT.DLL.
____________ laffo |
# |
June 10, 2006, 20:03 | |
Rhovanion
Exterminated 666 posts |
hahaha it sounds like "cunt". Lamest joke ever.
____________ |
# |
June 10, 2006, 20:13 | |
Sandman
F3n!x0r 1194 posts |
Really? I had not noticed that.
____________ BennuWiki Yes, my avatar has grey borders in IE (so get a decent browser) ROOFLEZ ROOFLEZ |
# |
June 10, 2006, 20:52 | |
Eckolin
Quite Whiskered 388 posts |
What features for the remaining 89 versions?
____________ Maker of Games... Wisdom is supreme; therefore get wisdom. Need help with coding? I probably wrote something similar. |
# |
June 11, 2006, 05:58 | |
Sandman
F3n!x0r 1194 posts |
Version 0.12 is out, get it while it's hot. Quoting Eckolin: What features for the remaining 89 versions? I have a few ideas left, but I'm open to suggestions. Currently the biggest thing I still want to add is UDP support, but apart from that there are some other internal systems, like a failsafe to ensure there are no message losses. ____________ BennuWiki Yes, my avatar has grey borders in IE (so get a decent browser) ROOFLEZ ROOFLEZ |
# |
June 11, 2006, 12:23 | |
DTM
Earthling! 823 posts |
Cool. When my exams are over I will make use of it.
____________ :o |
# |
June 11, 2006, 14:21 | |
Rhovanion
Exterminated 666 posts |
how about 1 server, multiple clients?
____________ |
# |
June 11, 2006, 14:37 | |
Sandman
F3n!x0r 1194 posts |
That's done easy enough, just connect to the server with multiple clients.
____________ BennuWiki Yes, my avatar has grey borders in IE (so get a decent browser) ROOFLEZ ROOFLEZ |
# |
June 11, 2006, 15:33 | |
Rhovanion
Exterminated 666 posts |
yaaaaaaaaaaaaaay!! let us make an MMORPG! ____________ |
# |
June 11, 2006, 15:52 | |
Fiona
games are terrible -9616558 posts |
Quoting Rhovanion: yaaaaaaaaaaaaaay!! Already started!
let us make an MMORPG! ____________ laffo |
# |
June 12, 2006, 01:41 | |
Sandman
F3n!x0r 1194 posts |
Quoting Sandman: Quoting Eckolin: What features for the remaining 89 versions? I have a few ideas left, but I'm open to suggestions.Currently the biggest thing I still want to add is UDP support, but apart from that there are some other internal systems, like a failsafe to ensure there are no message losses. There seem to be occasional message losses still. I have a few possible explanations for this: 1. SDL_Net has an unkown malfunctions. 2. The message is skipped by SDL_Net. 3. Because of Fenix' frame-behaviour. 4. The message gets blended with the arriving message. After thinking, I'd say 4 is the most logical explanation. The message seems to be lost, because each message has a terminating NULL at the end. So after the 'received' message's NULL, there could be anything, because it wouldn't be picked up. The cause of this would be 3. So the plan is to check this out and fix it if this is so. I do think this is possible, so yay for all of us. Furthermore, here is a list of the things I probably will do as well: - Use a stack to send and receive messages (optionally with an ID code and handle messagelosses using that ID code). - Let the Fenix programmer set the maximum number of messages to receive and send on one connection. (Combined with the stack of course). This way messagelosses by the frame-behaviour of Fenix would be prevented. And a totally different thing: Stuckie helped me to compile a library I wanted to use for a long time. This library is a multithreaded network library capable of doing 30000 messages per second. So yay for all of us again, since I'm planning on making a Fenix DLL for that DLL. Let's hope SDL lets me use it, because I think it'll have much more capabilities then this unthreaded one, though a regular (or even demanding) Fenix game wouldn't need such power. ____________ BennuWiki Yes, my avatar has grey borders in IE (so get a decent browser) ROOFLEZ ROOFLEZ |
# |
June 19, 2006, 02:46 | |
Rhovanion
Exterminated 666 posts |
if you can handle when a message gets lost, you could test it in the fenix program and resend it. Some kind of window checksum? I dunno.
____________ |
# |
Page 1 , 2 , 3 , 4 , 5 , 6 , 7 |
Message Board > Fenix / Bennu / Gemix / DIV > [DLL] Network.DLL