tags:

views:

626

answers:

3
A: 

I believe Indy 9 came with Delphi 6 and Indy 10 does come with Delphi 2007 so the problem appears to be the differences between Indy 9 and Indy 10. Unfortunately, Indy 10 was not always backwards compatible.

Here is a brief overview of some of these changes Object Hierarchy Changes in Indy 10

The interesting part is you say the Net client connects fine...assumedly with the unmodified version of your server simply recompiled with Delphi 2007? If so then it sounds like you may have Indy 10 already installed to build your Delphi 6 system...

Darian Miller
@Darian - yup. The original code recompiled in D2007 works perfectly when I connect to it with a .NET client. I might have to do what @Roddy suggested and use a tool like WireShark.
John Kraft
Since it recompiled without changes in D2007, then it's a given that the default install of Indy with Delphi 6 was previously modified (otherwise it wouldn't compile without code changes.) I'd agree that sniffing the traffic might really help, but I'd also look at the date/time of the Indy files on the Delphi 6 box and see if there are any out of sync with the others to see if the default Indy behavior was changed on the Delphi 6 box. I would hope that someone didn't modify Indy code directly, but it's happened before...
Darian Miller
@Dariean - I apologize, I should have been clearer. I was referring to the code snippet I posted. I did have to modify the overall codebase to get it to compile in D2007; changing TidThread to TidContext and such.
John Kraft
A: 

Sounds like it's time for you to fire up WireShark and see what's actually being sent/received. That might give you the clue that you need.

I had an issue which caused me problems upgrading from Indy 9 to Indy 10 with C++Builder2009. The TIdTcpClient "Connect" method in Indy 9 has a declaration roughly like this

void Connect(int ConnectTimeout);

In Indy10, "ConnectTimeout" is now a property, and the Connect method now has a declaration similar to this:

void Connect(String HostName);

So my old code with "Connect(5000);" compiled fine (because there's an automatic conversion operators from Int to String) was now tried to connect to a host called "5000"....

Roddy
That's certainly not a problem in Delphi since there will be no implicit cast from Int to String. The code would result in a compiler error instead.
Smasher
+1  A: 

Problem solved. The following code works...


AContext.Connection.IOHandler.CheckForDataOnSource(10);
  if not AContext.Connection.IOHandler.InputBufferIsEmpty then
    begin
      data := AContext.Connection.IOHandler.InputBuffer.Extract;

After closely inspecting the stream (as suggested by @Roddy), I was able to determine that the VB6 application was not sending a CRLF on the connections, which was causing the AContext.Connection.IOHandler.ReadLn; to block waiting for a CRLF that never came.

Thank you @Darian and @Roddy for helping me find the answer.

John Kraft