Link to home
Start Free TrialLog in
Avatar of SOTHDEV
SOTHDEV

asked on

Infinite loop in Indy Exception Handling

Using Delphi, I have a client / server application which requires an Indy (from 2016) based connection. The problem scenario is very specific. During a data transfer from the Server, the Server disconnects. Indy recognizes this and Raises an Exception (usually 10054) but can fall in to an infinite loop, where it just continues to raise the same Exception over and over again. This exception is only seen in Debug mode, so just appears as an infinite loop to a client. I have a Try / Except block surrounding the test operation in an attempt to catch the Exception but it never exits.
Avatar of Sinisa Vuk
Sinisa Vuk
Flag of Croatia image

Please post your code here. I assume you doing something wrong. Indy will not loop infinitive - I sure.
Avatar of SOTHDEV
SOTHDEV

ASKER

I have tracked this further and may be a problem with the TkbmMWTCPIPIndyClientTransport middle layer I am using. I have an OnException Event tied to my Client Object,
but in kbmMWClient

function TkbmMWCustomClient.InternalSendRequest(AServiceName,AServiceVersion:string; AStateID:integer; AFunc:string; {$IFDEF KBMMW_LICENSE_MESSAGING}AAsync:boolean; var ARequestID:integer;{$ENDIF} const Args:array of Variant):Variant;
.
.
.
                                   on E: Exception do
                                   begin
                                        if Assigned(FTransport.FOnClientException) then
                                        begin

It does not find it assigned. I will have to track it down, as every other event on FTransport seems to be assigned properly.
ASKER CERTIFIED SOLUTION
Avatar of SOTHDEV
SOTHDEV

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SOTHDEV

ASKER

Once I corrected the 3rd Party code it resolved the issue