Reputation: 1
I've developed a small client/server application with Duplex WCF, but I'm running into a problem trying to detect if client has lost connection to the service.
On service side, to detect "dead" clients I simply catch the callback: if fails, then I remove the client from the list.
On client side, how can I detect if client has been disconnected from the server (IE client lost network)?
I've tried with
((ICommunicationObject)m_InstContext).Faulted += new EventHandler(ConnectionCrashed);
((ICommunicationObject)m_InstContext).Closed += new EventHandler(ConnectionCrashed);
But seems that it fires only on client => service call, not on callback channel faulted.
My client software makes an initial call to the service and then just waits for the server callbacks. I've added reliable sessions too, but seems that it's not possible to catch the failed keep-alives as well.
Is there any other solution to check if callback channel is still active from client side?
Thanks
Upvotes: 0
Views: 46
Reputation: 1
Solved: I need to check on Faulted/Closed on the service itself and not on InstanceContext
Upvotes: 0