user3641972
user3641972

Reputation: 1

Delphi 7 & indy 9 Buffer Reader issue, Not reading all Packets

I have an Delphi app (Developed in Delphi 7 utilising indy 9) that connects to an Java Server application.

The communication is working perfectly in our Staging environment. The issue happens in our Production Environment.

I did a TCP dump and was able to track all the data packets, All the data is deliver onto the network interface card where the Delphi app is running. Our MTU is set as default on 1500

The total packet size is on average 15kb.

When the delphi app is reading the buffer it only reads a the fist few packets on the buffer and not the full response.

I was able to see that with on output to a text file of the data read from the buffer.

Upgrading to indy 10 is out of the question, We are in the process of migrating all our applications to a java environment.

Upvotes: 0

Views: 371

Answers (1)

Prabhu
Prabhu

Reputation: 3541

I am not aware of delphi/Indy-9. The following is just an observation on TCP applications.

In TCP based applications if there aren't application level markings(start and end) for the data exchanged one method usually followed is to encode the data length in say 2 or 4 bytes and prepend these bytes to actual data. The TCP application that receives such data should read the length bytes and keep reading until that many bytes arrive and then process further.

In your case - may be the receiving application is interpreting the first few bytes as length but which actually is not. But payload. The value can be high. So the application isn't processing further because it hasn't received yet that many bytes that it thought.

Upvotes: 2

Related Questions