nlneilson Messages: 644 Registered: January 2010 Location: U.S. California. Mojave &...
Contributor
It has been several years since tinkering with different code for sockets so my memory is a bit fuzzy.
What you mentioned about "Lower level sockets work with \0 and buffer sizes" may be a clue as why \0 seems important to me.
I still do much of my parsing a character at a time rather than split at ','. The time difference now with faster CPUs is negligible.
I think it was back using Python for a client the Sleep time before data was out of order or garbled was 2 milli second on a dual core and 5 on a slower single core when using \0 as end of transmission. Any other way the time would be more. The server is on a thread and can accept several clients and have tried up to 5 without a problem except when trying to open and close the connections too fast. The amount of data sent doesn't make much difference as it is so fast from a few bytes to a few thousand as long as any parsing is not done in the server code.
There may be better ways like shared memory but that is above me.
It's good to go over stuff again and have my memory corrected when necessary.