How to get a reference to IDuplexChannel, IDuplexSessionChannel or IOutputChannel in Wcf
- by wizlb
I have a duplex Wcf service and I'd like to get a reference to IDuplexChannel, IDuplexSessionChannel or IOutputChannel so that I can use the non-blocking BeginSend method.
On my server, inside of the handler for the initiating method I have the following (I have tried every interface that I listed in place of IOutputChannel. None of them seem to exist.)
_clientCb = OperationContext.Current.GetCallbackChannel<IDxClientCb>();
_channel = OperationContext.Current.Channel;
_duplexChannel = _channel as IOutputChannel;
Debug.Print("Service IOutputChannel null: {0}", _duplexChannel == null);
Similarly, in the client I have tried to cast the return value of DuplexChannelFactory.CreateChannel() to any of these interfaces and I always get back a null.
How do I get a reference to one of these?