Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to handle exceptions TIdTcpServer, TIdTcpClient
I recently took over development/maintenance on a project written in Builder C++ 6 and just converted to Indy 10.   Some quirky unexpected problems occurred that seem to be related to the error handling.  I am pretty much a novice when it comes to Indy so I'm struggling to figure it all out.

Web searches found several comments by RLebeau that said "let the server handle the exceptions".   I looked, but never found, for code samples that would clarify what he meant. 

In this case TIdTcpServer Execute calls DoPassthruServerExecute, which calls HandleFirstCallerMessage, both of which have try ... catch sections.  There is also a TIdTcpClient and a ReceiveThread (TThread, TIdContext which is passed the server context) that has a try .. catch block, and which catches EIdConnClosedGracefully.

I've attached a stripped down code that has all the essential code and error handling.  I would greatly appreciate it if someone could take a look at it and let me know if they see any obvious problems or design issues.


Messages In This Thread
How to handle exceptions TIdTcpServer, TIdTcpClient - by whitekn3 - 05-08-2019, 01:24 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)