My basic set up is as follows:
- service is set up to have a duplex contract between the client and server.
- Server can only have one client connected at a time, once a client connects, the server locks to deny new connections.
Every thing works as expected unless a client does not properly disconnect. So to solve this, I have included a timer on the server, to "ping" the client every 2 seconds. If the method throws an exception, the client is not connected anymore, and the server
will unlock to allow a new connection.
My problem is that the OperationContext.Current.GetCallbackChannel<T> method always returns a null reference and throws an exception in my Tick method regardless of whether or not a client is connected because I am using it in a method that
was not invoked by the client.
I know my current set up does work because I can call other "duplexed" methods in methods the the client invokes server side, and the OperationContext.Current.GetCallbackChannel works as expected.
So how do I grab the proper channel to talk back to the client in my timer's tick method? Thanks
View Complete Post