NetTalk Central

Author Topic: Internal error with server  (Read 5213 times)

Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
Internal error with server
« 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

JohanR

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
    • Email
Re: Internal error with server
« Reply #1 on: July 18, 2023, 10:17:00 AM »
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

Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
Re: Internal error with server
« Reply #2 on: July 18, 2023, 10:20:13 AM »
Thanks Johan. Definitely a possibility.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Internal error with server
« Reply #3 on: July 18, 2023, 09:09:11 PM »
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.

Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
Re: Internal error with server
« Reply #4 on: July 18, 2023, 09:25:31 PM »
Thanks Bruce.

Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
Re: Internal error with server
« Reply #5 on: July 24, 2023, 04:13:35 AM »
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

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Internal error with server
« Reply #6 on: July 24, 2023, 06:38:32 AM »
depends what code you have in MyMessage...
You'll probably also want to hook Stop, as that also pops up.

Cheers
Bruce

Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
Re: Internal error with server
« Reply #7 on: July 24, 2023, 06:57:24 AM »
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

Jane

  • Sr. Member
  • ****
  • Posts: 372
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
Re: Internal error with server
« Reply #8 on: July 24, 2023, 05:07:27 PM »
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).

Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
Re: Internal error with server
« Reply #9 on: July 25, 2023, 03:50:35 AM »
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.