简体   繁体   中英

Web Service client aborted connection

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.

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#?



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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM