NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Thys on July 17, 2023, 09:21:26 PM
-
Hi,
Our backend server uses NT11 for incoming API calls. The EXE sometime closes without reason (not the problem to discuss here), but the web server then states "Unable to Close connection" in the function NetSimple.CloseServerConnection. What could be the reasons that it can't close "the connection"?
Thanks
Thys
-
Hi Thys,
Perhaps a leftover running thread somewhere or similar?
I had a NT mail procedure that I only closed the thread on the success, but forgot that I did not close the procedure on the errortrap routine for debugging and even if you close the app the process still runs.
cheers,
Johan
-
Thanks Johan. Definitely a possibility.
-
That error occurs when the connection is already closed. You can't close it because it's not open.
Connections can be closed by either end, and this error report can safely be ignored.
-
Thanks Bruce.
-
And to follow up, the EXE is run as a Windows service. Sometimes it hangs for some reason, no way to find out why. When compiled in release mode, is it maybe possible that any library, whether it's NT or any other with Clarion, may cause the message to pop up, event after setting system{PROP:MessageHook} = address (MyMessage)?
Thanks
-
depends what code you have in MyMessage...
You'll probably also want to hook Stop, as that also pops up.
Cheers
Bruce
-
Bruce,
The hook function I have logs the message content so that the code can flow on. I'm not sure how to hook a STOP message though - there doesn't seem to be something for that. But I do see there's a PROP:LastChanceHook also - maybe that will provide an answer. Will internal messages from NetTalk be caught with PROP:MessageHook and PROP:LastChanceHook or are they all directed to the error trap method?
Thanks
-
is it maybe possible that any library, whether it's NT or any other with Clarion, may cause the message to pop up, event after setting system{PROP:MessageHook} = address (MyMessage)?
Thanks
Yes!
If you're using SQL, the SQL driver can pop up a login message box no matter what you have hooked in Clarion.
To suppress that you can use the driver option
/LOGONSCREEN=FALSE
I use that switch in conjunction with the SQL disconnect class that Rick Martin showed as part of CIDC 2020 (and Capesoft MessageBox).
-
Hi Jane.
I know about the login popup that I need to deal with early-on when running the app. But this problem occurs later on however, after running successfully for a while. In fact, in this app I don't use the normal Clarion db drivers because when SQL drops, a typical Clarion application can't recover. So, we're rather using ADO.
I need to consider that it could be an external problem, not a popup at all - like anti-virus not liking the fact that the EXE is an HTTP server listening on a specific port, or that it's running scripts. I'll keep on digging.
Thanks for the suggestion.