From what I can gather, the connection that is made by the HTTP requests is
a non-exclusive connection. It's hard to tell since the connection is made
by a method implemented in the CLR (namely, EstablishConnectionForUrl). If
the connection is non-exclusive, this means that once the connection is made
it can be shared with any other application that may wish to use the
connection. Since there is no mechanism for determining if another
application is making use of the connection, it cannot be closed
programmatically or it could seriously wreak havoc with some other
application relying on the connection. This seems to be standard behaviour
with Connection Manager, as I came across the very same issue when coding a
managed Connection Manager wrapper.
Interestingly, if you dig into the HttpWebRequest class, there is a private
method called ReleaseConnMgrConnection which calls the underlying Connection
Manager API of the same name. This makes an attempt to release the
connection handle opened by Connection Manager. As I discovered through my
own research, if the connection is non-exclusive, calling the
ReleaseConnMgrConnection will succeed, but the connection will not be
dropped.
--Neil
--
Neil Cowburn, MVP
Co-Founder, OpenNETCF.org
WWW:
www.opennetcf.org