How to get the RealProxy when I know only the tran

2019-06-24 01:53发布

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条回答
贪生不怕死
2楼-- · 2019-06-24 02:04

There's a function in RemotingServices specifically for this:

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

查看更多
登录 后发表回答