I have a WCF service on a duplex channel, with a callback contract. The service keeps track of the clients by storing the result of OperationContext.Current.GetCallbackChannel<T>()
in a list when a client calls a SubscribeMe()
method on the service. The service will periodically ping these callback channels to keep track of their validity, and expire those that are closed or timing out.
The question I have is this: How do I get information about the remote host when the remote host is not actively making a request to my service, such as when I'm calling MyCallbackContract.Ping()
?
I tried casting the callback channel object to IContextChannel
, and accessing the IContextChannel::RemoteAddress
property, but this property contains some kind of namespace URI that has nothing to do with the actual remote host on the callback channel.