sdl_ios
sdl_ios copied to clipboard
SDLProtocol message parsing
The current process is:
- Receive Bytes
- Check buffer for header length
- Process header
- Check buffer for message length
- Process message
- Remove header and message from buffer
- Route the message
Every time the full message is not in the buffer and bytes are received the header is re-parsed. A state machine should be used to parse the incoming bytes.
A state machine is entire retooling of the packet deconstruction process. If we want to do this without a full retool (for now :smile:), we could also do this with some logic fixes.