c# - WCF Full Duplex Handle Client Disconnection -
Do I have a way to detect customer disconnection from my service? I get the chance to find out that a fixed client is disconnected on the attempt-grip method, which is not a very good way to do this. I do not want to create a timer for every new customer who joins my service, just to monitor your final transaction.
No, there is no simple or elegant way to detect customer disconnection. It would be a good environment, if the client stopped or crashed, the service found the "client turbinated" event. However, this behavior is not only fit with message-based architecture.
A great solution is to ping the client to callback method, and see if this call time is out or not.
Alternatively, if you are using instancing per session, you can set the inactivity timeout to a small value (i.e., as opposed to the default 10, one minute), and Empty method on a server on client side from time to time.
See for a similar discussion.
Comments
Post a Comment