GelNet is an ultra-light networking library. Right now it can only perform UDP networking, but in version 1.0 it will support TCP/IP connections as well. Its syntax is extremely simple and easy to interpret. Everything needed for the library is shown in the 21 line sample project and the library is only 24 kilobytes in size.
Download is here (A tutorial should not be needed):
Issues:
While this is good for some applications, TCP is a far better choice except in the area of VoIP and player updates. When you send UDP, you don’t know if the other side got it. So, if a door opens and the client misses that packet, the door will continue to look closed to the client.
In addition: it is not open source, the license forbids modification, and there is no documentation. (E.g. What does UDPSocket.getPacket do? Does it use a FIFO or a FILO queue? What does it return if the application changed userlevel and can no longer access the socket? How do I get data out of the packet?)
P.S. What if you send a 0 through sendPacket? Is that indistinguishable from no packet at all?
That’s exactly why I’m going to add TCP/IP.
Documentation will come with version 1.0, and do you mean send a null packet, or send a packet with null data?
A packet with null data, I think.
Then it would send data 0. Sending a null Packet would just create a null reference exception.
I’m referring to this section:
//If there is a packet break out of the loop so that the application may quit.
if(p != 0)
break;
If you send 0, doesn’t that appear the same as no packet?
Also, you use
if(p)
How is this different from p !=0?
If you may notice, “p” is not the packet’s data. It’s a pointer. If it points to NULL, then it is pointing to no packet.
And it’s different from “if(p)” in that it is explicit in its meaning. Should I really obfuscate example code, with only a loss of 4 characters of space used by the source? Are five bytes that important?