Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / August 2005

Tip: Looking for answers? Try searching our database.

How do you send a Connection: Close header?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ChadH - 19 Aug 2005 17:02 GMT
How do you send a Connection: Close header?

We have a .Net application that runs on a server.  It has a reference to a
.Net web service.

We want to force the connection to close because the web service is behind a
load balancer as there are multiple boxes processing this service.  Because
my “client” is really an application server that takes requests from 100s of
users we don’t want the automatic reuse of the HTTP connection.

We have tried the following:

    System.Net.HttpWebRequest request =
(System.Net.HttpWebRequest)base.GetWebRequest(uri);
    request.KeepAlive = false;

That removes the Connection: Keep-Alive header, but does not cause the
connection to be closed.

    System.Net.HttpWebRequest request =
(System.Net.HttpWebRequest)base.GetWebRequest(uri);
    request.Connection = “Close”;

This throws an exception, it appears you can’t really set this.

We have also tried using a unique ConnectionGroupName for each call, no help.

Any help would be greatly appreciated.

Thanks

Chad
shriop - 22 Aug 2005 04:42 GMT
Offhand, I can't answer your question directly, but are you sure that
you absolutely have to send that header value to get your load balancer
to close the connection? I'm assuming you've noticed an issue, and if
so, have you tried making sure you call Dispose on the HttpWebResponse
object? Also, try specifying this

ServicePointManager.Expect100Continue = false;

Bruce Dunwiddie
http://www.csvreader.com

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.