Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Closing web service client does not close connection - but can it be done manually?

Posted on 2012-03-15
2
437 Views
Last Modified: 2012-08-14
When I close my web service client (by calling .Close( )  ) it does not close the underlying socket connection on the server, but leaves it in a TIME_WAIT state:

 TCP    [::1]:64844            [::1]:65119            TIME_WAIT       0

This is not a bug, it is by design.  Under normal conditions, this is not a problem.  But when the application is scaled up, we begin to experience problems because new connections are not being released fast enough to accommodate the new web service method calls.

My research has indicated that the minimum time setting "clean up" old socket connections is 30 seconds.

We've also doubled the number of available connections.

For now the doubling of the connections seems to be alleviating the problem.

We understand that the web service seems to not be able close the connection manually.

My question is - how might we close the connection manually?


I know that the reason the connection will not close sooner than it does is because it is waiting for any packets that may arrive out of order.  And, the OS wants to ensure that a packet intended for a connection that is closed does not get processed by a connection that is still open.

That works for the OS, but it does not work for our needs.  We are writing the code so we know when the work is done and the connection can be closed.  If we could reduce the amount of time below 30 seconds - say down to 5 seconds - that might be an okay alternative.


I want to explore this as an option.
0
Comment
Question by:knowlton
2 Comments
 
LVL 25

Accepted Solution

by:
apeter earned 500 total points
ID: 37739970
Hope you are calling async. calls as much as possible to manange the connection problems.
0
 
LVL 5

Author Comment

by:knowlton
ID: 37740032
I can check on this.  The system has been in place for a while, so I would imagine this has been addressed at some point.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ajax jquery cross domain issue 18 154
WCF Service to read Message from MSMQ Automatically 6 85
WCF enums not functioning like "vanilla" enums 3 126
RestSharp 5 188
This tutorial will show you how to add an attribute to an XML (http://en.wikipedia.org/wiki/XML) stream returned from a Windows Communication Foundation (http://en.wikipedia.org/wiki/Windows_Communication_Foundation) (WCF) Web Service.  Some knowled…
Here I am going to explain creating proxies at runtime for WCF Service. So basically we use to generate proxies using Add Service Reference and then giving the Url of the WCF service then generate proxy files at client side. Ok, what if something ge…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question