3

我想访问频道的状态。我收到了包含 RealProxy(rp) 的 __TransparentProxy。我可以使用这个函数 GetRealProxy() 访问它

但是,我仍然无法从 Real 代理获取状态。我需要从 realproxy 获取 ServiceChannel 并访问状态。只需将其转换为 IServiceChannel 就会返回 null。

((System.ServiceModel.Channels.CommunicationObject)(((System.ServiceModel.Channels.ServiceChannelProxy)((((System.Runtime.Remoting.Proxies.__TransparentProxy)(connectionManager.transparentProxy)))._rp)).serviceChannel)) 。状态

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

获得 RealProxy 后,要访问状态,我仍然需要它。

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

有没有办法访问 ServiceChannelProxy 或 ServiceChannel 或 RealProxy 的状态?

谢谢!

4

0 回答 0