tags:

views:

7

answers:

1

I've setup an example in which a client calls a WCF service that has a Callback registered. It all works perfectly, but I want to test the scenario in which the client is closed, but the Service is still doing it's thing. Then when it comes time for the Service to call back to the client, I get an error because the client ain't there anymore. Is there a recommended way for me to validate in the Service that that the client is still there before trying to call back to it via the CallBack channel? I've tried accessing OperationConext.Current(), but this is null in the context of the callback method. --Shawn.

A: 

You have already found one recommended method - call the client and see if it works.

TCP/IP can't always detect client shutdown. In particular, it's often necessary to send a packet to the other side to see if it is still there.

John Saunders