Sep 04, 2018 03:10 PM|mgebhard|LINK
The posted code ignores exceptions. The code assumes the receive buffer has the entire message on the first read.
It looks like you based your code on the synchronous socket programming docs but did not follow the pattern. The docs shows the data read in a loop until all the data is received. Your code tries to parse the data as soon as data is available. In TCP
there is no guarantee the receive buffer has a complete message.
I'm not sure what "same format" means as it looks like you're parsing a string. I assume you are seeing effects if processing the second part of a message.