G
Guest
Hi,
I have a huge problem with HttpWebRequest/HttpWebResponse.
The problem is when i generate a request using HttpWebRequest to a web
server, when the webserver responds with "403 Forbidden" the connection to
the web server is automatically closed by the .net (i guess by
HttpWebResponse instance)!
I trace the packets and i see that although i get from the web server
"Connection: Keep-Alive" header, the .net framework sends tcp Fin to the
webserver. Of course i forgot to mention that i use http 1.1 and just to make
sure i also set the HttpWebRequest.KeepAlive header to true.
The framework seems to close the "persistent" connection only when it gets
"403", if it gets "404" the connection keeps persistent as it should.
I also debug this situation and saw that the connection immediately close
right after the call (HttpWebResponse)request.GetResponse() is done - long
before the code gets to the response.Close() line.
This behaviour is very critical to my application. I must keep persistent
connection with web server at all time (this is http 1.1 !). The webserver
does not send "Connection: close" header and there is no reason to close the
connection with the web server!! By the way, i did the same with IE browser
and IE acts ok (it does not close the connection).
Please help me with this.
Thanks a lot.
I have a huge problem with HttpWebRequest/HttpWebResponse.
The problem is when i generate a request using HttpWebRequest to a web
server, when the webserver responds with "403 Forbidden" the connection to
the web server is automatically closed by the .net (i guess by
HttpWebResponse instance)!
I trace the packets and i see that although i get from the web server
"Connection: Keep-Alive" header, the .net framework sends tcp Fin to the
webserver. Of course i forgot to mention that i use http 1.1 and just to make
sure i also set the HttpWebRequest.KeepAlive header to true.
The framework seems to close the "persistent" connection only when it gets
"403", if it gets "404" the connection keeps persistent as it should.
I also debug this situation and saw that the connection immediately close
right after the call (HttpWebResponse)request.GetResponse() is done - long
before the code gets to the response.Close() line.
This behaviour is very critical to my application. I must keep persistent
connection with web server at all time (this is http 1.1 !). The webserver
does not send "Connection: close" header and there is no reason to close the
connection with the web server!! By the way, i did the same with IE browser
and IE acts ok (it does not close the connection).
Please help me with this.
Thanks a lot.