zoukankan      html  css  js  c++  java
  • WCF端口共享

    当两个WCF应用程序想共享一个端口提供服务时,如果想不冲突,需要开启WCF的端口共享,并启动一个服务Net.Tcp Port Sharing Service。

    ServiceHost host = new ServiceHost(typeof(WCFPortSharing.AddService)); 
                NetTcpBinding binding 
    = new NetTcpBinding(); 
                binding.PortSharingEnabled 
    = true
                host.AddServiceEndpoint(
    typeof(WCFPortSharing.IAddService), binding, "net.tcp://127.0.0.1:4503/addService"); 
                host.Open();

    ServiceHost host1 = new ServiceHost(typeof(WCFPortSharing.SubService)); 
                NetTcpBinding binding1 
    = new NetTcpBinding(); 
                host1.AddServiceEndpoint(
    typeof(WCFPortSharing.ISubService), binding1, "net.tcp://127.0.0.1:4503/subService"); 
                host1.Open();

  • 相关阅读:
    C++ reference
    C++ const 限定符
    POJ 1222 EXTENDED LIGHTS OUT(高斯消元)
    poj 2185
    poj 2406
    poj 2752
    hdu 6171
    hdu 6127
    uva 3708
    hdu 6092
  • 原文地址:https://www.cnblogs.com/JayK/p/2955002.html
Copyright © 2011-2022 走看看