+1 Drew_Benton
You have laid down an excellent foundation for those who need a head start to networking code. Excellent resources btw.
I am in the middle of coding an asynchronous multi-threaded networking server, and what Drew has is all true. My process during the creation of a small server seems to be the following:
- Decide different 'opcode' commands based on bytes or relevant data
- Create a 'handshake' process exchanging version info and (if necessary) encryption keys
- Put safety checks in place for ALL client data (authenticate occasionally)
In my code comments, I have the overall communication setup
'//Startup Communication//
'Client: Authenticate Handshake
'Server: Map and Object Creation
'Server: Local Vectors
'//Communication Loop//
'Client: Keyboard Keys
'Client: Inventory Requests
'Client: Chat Messages
'Server: Local Vector Updates
'Server: Local Inventory Updates
'Server: Local Chat Messages
'Server: Object Updates
Here is an article by Tim Sweeney (author of ZZT, my first programming / scripting language) within one of the articles posted above. http://unreal.epicgames.com/Network.htm
I'm using .Net, so I have access to API that does a little more than the Leadwerks Networking calls. Plenty can still be done with the given network functions.