Monday, 10 May 2021
  4 Replies
  1K Visits
  Subscribe
Hi Sergio,

Ran into a strange ARM only problem, I believe tied to processing speed. Basically, when a disconnect is detected (server side shutting down) the client will throw a segmentation fault on the second disconnect. Never the first. This happens after Indy throws a "ConnectionClosedGracefully" exception and before the OnClientDisconnect event is called. I've tracked this down to sgcTCP_client.pas, starting on line 597, in the On E: EIdSilentException do section.

Original code:

597    DoOnExceptionEvent(E);
598    if TCPMode = tcpmDefault then
599      raise;


Putting a sleep(10) after line 597 erases the issue, i've modified my unit to be:

597   DoOnExceptionEvent(E);
598   sleep(10);
599   if TCPMode = tcpmDefault then
600     raise;


I could not replicate this on the exact same program compiled for x86 windows, and did not try any sleep value less than 10.

If you'd like me to run any tests I'm happy to help.

-Caleb