Attix
Attix

Reputation: 115

Indy TCP Client data not received

Update Seems like this issue is not as close related to Indy as I thought and more a topic on multi threading. I'll keep the question open as I am not 100% convinced.

I have a working application which is exchanging ascii strings with communication partners using Indy TCP client. The communication flow looks like this:

  1. [Indy Level] Sender sends string
  2. [TCP Level] Wireshark tells that this packet was delivered to the recipient
  3. [TCP Level] The recipient sends a TCP ACK to confirm this packet
  4. [Indy Level] The IOHandler.ReadLn method of recipient returns the data
  5. [Indy Level] Via writeLn() a logical Acknowledgement is sent to the original sender

Recently I noticed that there a hickups in that communication, after fiddeling with wireshark I got the following picture:

  1. [Indy Level] Sender sends string
  2. [TCP Level] Wireshark tells that this packet was delivered to the recipient
  3. [TCP Level] The recipient sends a TCP ACK to confirm this packet
  4. [Indy Level] The IOHandler.ReadLn method of recipient does not return any data
  5. Nothing to do as no data is available for recipient

After some timeout the sender send the orginal message again because there was no logical Acknowledgment from the recipient.

So my question is: If wireshark tells me that the underlying TCP mechanics did their work, how is it possible that the Indy Client has no data available?

Regards, Attix

Upvotes: 2

Views: 252

Answers (1)

Attix
Attix

Reputation: 115

[SOLVED] The hint Remy provided was correct. I was calling Connected of the TCP Client outside its reading thread which messed up the input buffer and caused the non appearing message symptom.

Removing that (unnecessary) check solved this.

Upvotes: 1

Related Questions