I have some really old code that was compiled with the version of Indy10 that was included in Delphi 2007. Having recompiled this in Delphi 11.1 the TCP Clients that should connect to the server application no longer do so. I'm trying to connect to the server using 127.0.0.1 on port 50000. Instead I get "connection timeout" or "socket operation on a non-socket" errors.
Is there any documentation anywhere that details what has changed between Indy10 in Delphi 2007 and Delphi 11.1? All the links on the Indy Project website are broken so I haven't found anything there. According to the Log at the start of IdTCPClient.pas there are no changes between the two however a quick file comparison reveals quite a few changes including the change of Port value from Integer to TIdPort. I've recompiled our server application in Delph11.1 and it will accept connections from older clients compiled in Delphi 2007 but not from new clients (hence I suspect changes IdTCPClient may be giving me issues). Thanks in advance for any help.
The code that tries to open the connection is below;
function TClientServer.Connect(SuppressMsg : Boolean) : Boolean;
begin
Result := False;
if (FRunning = False) and (Connecting = False) then
begin
try
TCPClient.ConnectTimeout := FConnectTimeout;
Connecting := True;
if assigned(TCPClient.IOHandler) then
begin
TCPClient.IOHandler.ConnectTimeout := FConnectTimeout;
TCPClient.IOHandler.MaxLineAction := maSplit;
end;
TCPClient.Connect;
Result := True;
except on E : Exception do
begin
Connecting := false;
if SuppressMsg = False then
begin
{ Look at cycling through the servers in the FCoreServer list }
{ until we manage to connect to one. Perhaps we need to prompt }
{ the user to select the machine to connect to ? }
ShowMessage('Failed to connect to the core server !' + #13#10#10 +
'Please ensure server is running at address ' +
TCPClient.Host + ' (' + IntToStr(TCPClient.Port) + ')' + #13#10 + E.Message );
end;
end;
end;
end;
end;