views:

28

answers:

2

I have a custom HTTP server that implements the HTTP 1.1 protocol.

I have no problem using persistent connections, however, I never receive 'Connection: Close' from IE ( I haven't tested other browsers. ) Instead, the 'receive' times out because it seems IE closes the connection.

What header from IE should I look for to gracefully close the connection?

A: 

There is no requirement to have browser explicitly send Connection: Close. And it does timeouts in 60 seconds, which is defined in registry.

I don't see a problem to gracefully handle "manual" client disconnect.

BarsMonster
It's not that it's a problem, as you word it. It's that it would be nice if it could be done gracefully. If that's not possible then I guess it's not a problem ;)
Bob Jacobs
Well, even if browser would always send that, you will still need to handle the situation when connection drops gracefully.
BarsMonster
+1  A: 

The default setting of the "Connection" header in 1.1 is "keep-alive" when the header is not present. IE does not close the connection right away so it can utilize the same connection for subsequent requests, and then closes the connection after a timeout if you do not send any requests right away.

Remy Lebeau - TeamB
So, should I send a '100 - continue' or just let the connection timeout?
Bob Jacobs
You can only send a `100` reply if the client explicitally asks for it via an `Expect: 100-continue` header, and even then only in reply to a request that is pending. So you will just have to let your connection timeout normally. Like I said, even IE does not know right away whether a connection is going to be re-used or not, so it does not send a `Connection: close` header for HTTP 1.1 requests
Remy Lebeau - TeamB