Jump to content
Posted 05 May 2011 - 03:40 AM
Posted 05 May 2011 - 03:55 AM
Posted 05 May 2011 - 04:15 AM
Posted 05 May 2011 - 04:22 AM
Posted 05 May 2011 - 10:51 AM
Check out my book, Game Development with Unity, aimed at beginners who want to build fun games fast.
Also check out my personal website at bryanwagstaff.com, where I occasionally write about assorted stuff.
Posted 05 May 2011 - 12:12 PM
Actually, that is a good point. So, if I havent recieved all of the data I should be getting WSAEWOULDBLOCK and then I can act accordingly.
Posted 05 May 2011 - 04:43 PM
Posted 05 May 2011 - 05:41 PM
So, nType will identify to the app what sort of data to expect and what to do with it.
Does this sound feasable?
I am also going to look at IOCP as suggested earlier (or atleast a multi-thread approach), as I foresee problems with waiting around for data too long - like application litter, if the data gets caught up somewhere.
Posted 05 May 2011 - 06:37 PM
Posted 05 May 2011 - 11:06 PM
Posted 06 May 2011 - 12:25 AM
Posted 08 May 2011 - 06:39 PM
Posted 09 May 2011 - 12:15 AM
---visit my game site http://www.boardspace.net - free online strategy games
Posted 09 May 2011 - 05:47 AM
Posted 09 May 2011 - 12:57 PM
[ushort op-code][ushort length][bytes for message data]
or for a message of known length:
[ushort op-code][exact number of bytes for message data]
Posted 09 May 2011 - 03:47 PM
If the opcode tells you whether the data is known length or not, then that layer actually has to understand what the opcodes mean. This is a high degree of coupling that's generally not very robust. If you always send the opcode and length in a known format, then that layer can give you a complete packet, without needing to know anything about what might be in that packet, or what opcodes "mean."
Posted 09 May 2011 - 06:07 PM
That makes sense. I have been struggling to find a proper way to form my messaging system into true object orientated way of working: I knew that programming a way to "get next complete packet if there is one." would be awkward, if all messages have a size it will be cleaner and simpler.