سؤال

I am using a duplex communication over wsDualHttpBinding.

Each client that logs in to the server, a GUID and a callback channel are constructed and saved in a dictionary. ( A very standard approach )

I need a way for the service to detect when a client has shut down unexpectedly. I have tried hooking a function for the faulted handler at the server side, but it is never called.

I am guessing because the connection is half open on the server side since it uses different channels for the callback and the client channel in wsDualtHttpBinding.

Any suggestions?

هل كانت مفيدة؟

المحلول

I don't think you're going to get a solution to this. If you didn't need WS* compatibility, you could conceivably create a custom binding and channel that sent heartbeat packets between client & server periodically, similar to HTTP Long polling. When some number of heartbeats (say 2) is missed, assume the other end has disconnected. Otherwise, there's no way for the server to know the client has disconnected unexpectedly, until it times out.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top