Post
by malmedin » Sat 22 May 2021 22:14
I have send an example, but from your answer it seems I'm being misunderstood.
I will write excerpt from my last email here, maybe someone else can help.
I have intentionally blocked every port on server except 3050 in order to test my application in an environment where only 3050 is allowed, i.e. where secondary connection (for events) can not be established.
This prevents IBCAlerter to establish secondary connection and I am aware that IBCAlerter can not do its job (monitoring events) when it can not establish a secondary connection. In that case I would expect that IBCAlerter does one of the following (on line IBCAlerter1.Start):
- raises an exception at IBCAlerter.Start and gives me an opportunity to use try...catch statement to find out that events won't be received, but no, it just continues on the next line
- calls OnError event where I can act accordingly. By the way, what is the purpose of OnError event, it is documented but not published?
- silently stops listening
Any of the above would be acceptable, but it does not do any of that. Instead an exception is raised when opening a query (why?) and exception is not always the same. Exception is one of the following (so far observed):
- invalid database handle (no active connection)
- invalid transaction handle (expecting explicit transaction start)
- invalid statement handle
- SQL statement doesn't return rows
If I run application in Delphi IDE, the exception is always 'Unable to complete network request to host x.x.x.x'.
It seems that IBCAlerter does not properly handle situations when the server does not respond and somehow causes problems to other components. From the fact that line IBCAlerter.Start finishes in practically no time and execution continues to the next line I conclude that IBCAlerter does something behind the scene (starts thread maybe) which causes problems later.
I tested the same situation using FlameRobin using its Monitor events tool and it behaves as it should, it shows exception complaining about network request, events don't arrive, but everything else works.