2 ms·
Don't forget the perennial classic: len > N && len % N == 1 Due to off by one error, the last byte of a message is never sent if the message is larger than the
by hinkley 3y ago
Don't forget the perennial classic: len > N && len % N == 1
Due to off by one error, the last byte of a message is never sent if the message is larger than the buffer or the packet size (or not sent until the next message arrives, for stream protocols)
- lanstin 3y agoYeah, I had a djb net parser my (work) friends wrote that would end up dropping the connection if the last byte read was the byte before the separating comma. https://en.wikipedia.org/wiki/Netstring https://en.wikipedia.org/wiki/Netstring Only happened with very large database reads so that the 1440 byte segments hit that spot. New manager and he started mocking me during team meetings on why I was so obsessed with these load tests succeeding and then was amazed at the 2 char fix (adding +1 to the read till length call).
- deleted 3y ago[deleted]