NetTalk Central

Author Topic: 6.37 errors Unable to close connection  (Read 1976 times)

useless

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
    • Email
6.37 errors Unable to close connection
« on: July 11, 2012, 03:50:54 AM »
Having installed 6.37 I'm now getting websites which are throwing error messages for normal (80) or SSL (443) sites with numerous Unable to Close connection errors -34 and Error Sending data -40.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11191
    • View Profile
Re: 6.37 errors Unable to close connection
« Reply #1 on: July 11, 2012, 04:07:19 AM »
turn on "suppress error messages" for your WebServer objects. these errors are normal for those objects (and usually you just turn the errors on to remind you if you've forgotten to deploy the SSL DLL's)

cheers
Bruce

useless

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
    • Email
Re: 6.37 errors Unable to close connection
« Reply #2 on: July 11, 2012, 05:57:25 AM »
Burying my head in the sand by suppressing the error messages is not something I like doing, if any code I produce throws an error message I like to know about it so the suggestion is not an option especially since these NT webservers got hacked despite having windows firewall, external firewall device and Snort installed.

This error message Unable to close connection -34 is coming up as soon as I load the page although it seems to be random when it strikes.

Why is it trying to close the connection as soon as the page is or just after the page has been loaded especially as the Keep-Alive is set? Closing teh connection will lose the session ID and everything relevent to the user at the time.

What I've also seen is the occasional packet being processed in the debugger where the packet data has no value in Port or the FromIP field, maybe this is a clue as to whats going on but its especially hard as this seems to be a random event, sometimes you get loads of these without the debugger and then you'll be lucky to see this when trying to debug it, a timing issue perhaps?




Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11191
    • View Profile
Re: 6.37 errors Unable to close connection
« Reply #3 on: July 11, 2012, 06:25:13 AM »
Hi Richard,

>> Burying my head in the sand by suppressing the error messages is not something I like doing, if any code I produce throws an error message I like to know about it so the suggestion is not an option

I'm not saying you should ignore them - just that they should not pop up as MESSAGES because that will break the server.
The server relies on Events, and while the MESSAGE is open events are lost. Displaying messages on the server side is thus very bad. Feel free to log all the calls into that method, and then take what ever action you see fit.
(Personally, I use MessageBox to log the error, and not display it.)

>> Why is it trying to close the connection as soon as the page is or just after the page has been loaded

because that's how it works. Each request makes a connection, issues a request, gets a response and closes.

>> especially as the Keep-Alive is set?

Keep-alive is a suggestion, not a requirement for the server. In NetTalk's case each request is handled by a different thread, so there's no benefit to keeping the connection open.

>> Closing the connection will lose the session ID and everything relevent to the user at the time.

sorry - no. The connection is always fleeting. the connection has nothing to do with the session. _all_ connections close immediately after the response has been sent.

The errors you see in this case;
>> Unable to close connection -34

means that the browser has already closed the connection. Clearly one end will close the connection first, sometimes it's the server, sometimes it's the client. It throws a message into ErrorTrap because it has been instructed to close the connection, but that failed because the connection was already closed.

>> Error Sending data -40.

is likely the same thing - if the browser closes the connection before the reply is sent to them, then you try and respond on an already closed connection, then you'll get an error. Since there's nothing you can do (the connection is already closed) the error has no meaning.

>> What I've also seen is the occasional packet being processed in the debugger

If you mean the Clarion debugger - then the debugger itself is likely causing the error. You cannot debug the server in the debugger because of time-related issues. For example the browser will time out in 30 seconds. Also you've got incoming events coming in on various threads etc, then palmed off to worker threads. If you want to debug then use the _trace command, along with Debugview. (which is maybe what you meant.)

Cheers
Bruce