1

How can I know if a client has aborted/closed the connection from the server in a web service. I have an high traffic app and sometimes for intermitent communications my clients are aborting/closing the transactions and I have a positive negative, because I don't know if the client still waiting my response.

My webservice is in C# with framework 4.0

I need solve this from server.

mmmmmm
  • 32,227
  • 27
  • 88
  • 117
TedTel
  • 5,445
  • 3
  • 16
  • 6

2 Answers2

0

You can't this is how the HTTP protocol works

you have to implement your own code to test if the service is up:

How do I test connectivity to an unknown web service in C#?

Community
  • 1
  • 1
Massimiliano Peluso
  • 26,379
  • 6
  • 61
  • 70
  • There is no manner? my problem is like this user http://stackoverflow.com/questions/48859/detecting-client-disconnects-in-web-services – TedTel Jan 13 '12 at 17:56
  • There is not way using HTTP protocol it does not care if the connection drop even during the request(you do it every time you close your browser while you were browsing a webpage) – Massimiliano Peluso Jan 13 '12 at 18:10
0



One way you can minimize the problem is to use sessions in your webservice. Of course, this decision may bring other impacts (eg increased consumption of system resources) but will allow you to detect when a session is ended by the client inactivity. You will have to do some tests to find a timeout value that best suits your needs. The link below contains information on configuring Microsoft and consume a webservice using sessions:

http://msdn.microsoft.com/en-us/library/ms733040.aspx

I hope it helps. Happy coding!

GRGodoi
  • 1,946
  • 2
  • 24
  • 38