In theory it's possible we could have only part of a message in the buffer. Currently we throw that away; this fix changes it so we wait to see if the rest of the message will arrive. We also limit messages to less than 0x7e bytes, which seems reasonable. Finally, we add some comments to the parser.
NOTE This is a single commit on top of https://github.com/ccutrer/balboa_worldwide_app/pull/26 .
In theory it's possible we could have only part of a message in the buffer. Currently we throw that away; this fix changes it so we wait to see if the rest of the message will arrive. We also limit messages to less than 0x7e bytes, which seems reasonable. Finally, we add some comments to the parser.