I have been doing socket programming for many years, but so far I have never had a missed message using TCP. I have a Java server and client in C - both on the local host. They send short messages back and forth as strings, with some delays between them. I have one special case when a message never appears on the client side. This is reproducible, but strangely dependent on the machine.
To give more detailed information, I can debug the server side and see the dispatch followed by a flash. I can connect to the client and go through the selected calls (in a loop), but it just doesn't appear. Has anyone experienced this and there is an explanation other than a coding error?
In other words, if you have a connected socket and write on one side and read on the other, what could happen in the middle to cause something like this?
Another detail - I used tcpdump in the loopback interface and see a missed message.
source share