Click here to Skip to main content
15,887,434 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to access the State of the Channel. I'm receiving the __TransparentProxy which contains a RealProxy(rp). I'm able to access it using this function GetRealProxy()

But, I am still not able to get the Status from the Real proxy. I'll need to get the ServiceChannel form the realproxy and access the state. Just casting it to IServiceChannel returns me null.

C#
((System.ServiceModel.Channels.CommunicationObject)(((System.ServiceModel.Channels.ServiceChannelProxy)((((System.Runtime.Remoting.Proxies.__TransparentProxy)(connectionManager.transparentProxy)))._rp)).serviceChannel)).state

C#
RealProxy realproxy = System.Runtime.Remoting.RemotingServices.GetRealProxy(connectionManager.transparentProxy);


After getting the RealProxy, to access the state, I'll still need this.

C#
((System.ServiceModel.Channels.CommunicationObject)(((System.ServiceModel.Channels.ServiceChannelProxy)(realproxy)).serviceChannel)).state


Is there any way access the ServiceChannelProxy or ServiceChannel or the state of RealProxy?

Thanks!
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900