How to handle client disconnect with PollingDuplexHttpBinding

I am implementing a WCF service with a Silverlight 3 client that uses PollingDuplexHttpBinding for communication. What are the processing alternatives when a client closes his browser without first disconnecting from the server?

I know that ultimately this will throw a TimeoutException, which I can catch, but is there a better way to catch it?

Thank.

+3
source share
1 answer

You need something like this:

OperationContext.Current.Channel.Closed += new EventHandler(Channel_Closed);

The channel also throws a Faulted event, but the Closed event immediately closes.

+1
source

Source: https://habr.com/ru/post/1749263/


All Articles