Fog Creek Software
Discussion Board

Welcome! and rules

Joel on Software

HTTP connection pipelining

I'm trying to send a bunch of requests to the same HTTP server. In theory, the connection (or maybe 2 connections) should be shared among my series of requests.
However, for some reason the .net httprequest object seems to create a new connection every request I make.  Not having pipleining is a huge perf hit, made even worse when I try to use SSL.

If I montor the servicepoint.currentconnections, they either go from 1 to 0 and back, or increase for every connection I make. (it drops down if I read out and close the responsestream).

What am I missing here? The server is using NTLM, is there a bug in the .net HTTP classes which closes the connection after every NTLM request?

I've searched a number of plces on the web and haven't seen much written about this.

Wednesday, November 20, 2002

Acting in the mode of "ask the obvious questions": Are you sending the right headers to keep the connection open?

Does the server keep the connection open even if you ask for it to stay open?

Have you looked at the HTTP headers & responses?

Chris Tavares
Thursday, November 21, 2002

It's supposed to be sending the right headers automatically in .net. Or so I read from the docs.

I'll build a test app if I really need this code to work to see what's going on. I did run a network trace and things looked fairly normal. Well one odd thing was that if I didn't drain the response stream, it would start a new network connection before the old one even finished sending all the data; this would be cool if it had two connections (what it claims to try to do) and alternated between the two, but that doesn't seem to be what's happening.

I don't remember the exact headers in the network trace, and didn't look around for the TCP close flag to see who closed the socket, but it looked generally OK.

Thursday, November 21, 2002

*  Recent Topics

*  Fog Creek Home