How to get the RealProxy when I know only the transparent proxy

╄→尐↘猪︶ㄣ 提交于 2019-12-10 16:18:56

问题


I have a transparent proxy, for instance one generated by WCF:

        ChannelFactory<ICalculator> channelFactory = 
            new ChannelFactory<ICalculator>(
              new NetNamedPipeBinding(),
              "net.pipe://localhost/WcfTransparentProxy/Calculator" );
        ICalculator calculator = channelFactory.CreateChannel();

How do I get the RealProxy from the transparent proxy?


回答1:


There's a function in RemotingServices specifically for this:

System.Runtime.Remoting.RemotingServices.GetRealProxy( transparentProxy );



来源:https://stackoverflow.com/questions/3531230/how-to-get-the-realproxy-when-i-know-only-the-transparent-proxy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!