I've recently needed to upgrade an old Delphi 6 project to Delphi 2007. It is a server application using the Indy TidTCPServer component. I've followed all the examples I could find on upgrading to Indy 10.
The application interfaces with an old VB6 application (that we do not have the code for) via TCP/IP. I'm having a difficult time because the Execute event on the Indy component fires as soon as the VB6 application connects, but it does not write any data. This causes the application to hang waiting for the application to send data that never arrives.
The original code looked like:
data := AContext.Connection.IOHandler.ReadLn;
if data <> '' then
begin
// do some stuff
end;
I've tried several code examples from the Indy examples, as well as here on StackOverlow. An example is:
AContext.Connection.IOHandler.CheckForDataOnSource(10); if not AContext.Connection.IOHandler.InputBufferIsEmpty then begin data := AContext.Connection.IOHandler.ReadLn(); if data <> '' then begin // do some stuff end; end;
Strangely enough, the original code works flawlessly when I hit it with a .NET client. This only seems to be a problem coming from the VB6 application.