示例#1
0
 public static void SetClientBaseAddress <T>(this DuplexClientBase <T> proxy) where T : class
 {
     lock (typeof(WsDualProxyHelper))
     {
         int portNumber = FindPort();
         SetClientBaseAddress(proxy, portNumber);
         proxy.Open();
     }
 }
示例#2
0
        public static I CreateInstance <S, I, C>(C callback) where I : class
            where S : class, I
        {
            DuplexClientBase <I, C> .VerifyCallback();

            InstanceContext <C> context = new InstanceContext <C>(callback);

            return(CreateInstance <S, I, C>(context));
        }
示例#3
0
        public static void SetClientBaseAddress <T>(this DuplexClientBase <T> proxy, int port) where T : class
        {
            if (proxy.State == CommunicationState.Opened)
            {
                throw new InvalidOperationException("Proxy is already opened");
            }
            WSDualHttpBinding binding = proxy.Endpoint.Binding as WSDualHttpBinding;

            Debug.Assert(binding != null);

            binding.ClientBaseAddress = new Uri("http://localhost:" + port + "/");
        }
示例#4
0
 static DuplexChannelFactory()
 {
     DuplexClientBase <T, C> .VerifyCallback();
 }