wcf - namedPipe dabble in



Suppose that you have some service which is in net.tcp, and you have declared the services as something like this: 

<services>
      <!-- TabularPushService -->
      <service name="WcfPub.TabularPushService">
        <endpoint address="net.tcp://127.0.0.1:9999/TabularPushService" binding="netTcpBinding" contract="WcfPub.ITabularPushService" />
      </service>
    </services>    
  </system.serviceModel>
and you might want to change that a named Pipe binding, so the Service might change to something like this:
<service name="WcfPub.TabularPushService">
        <endpoint address="net.pipe://localhost/TabularPushService" binding="netNamedPipeBinding" contract="WcfPub.ITabularPushService" />
      </service>
note in one aspect the endpoint address is specified like this:
net.pipe://localhost/TabularPushService

It looks like that it accept some net port like address, but you cannot apply the http/tcp port here, so it is illegal to use the following notatino for the address URL.

net.pipe://localhost:8080/TabularPushService
To translate this namedPipe binding to code, you will probably get the following.
ServiceEndpoint endpoint = new ServiceEndpoint(
                ContractDescription.GetContract(typeof(ITabularPushService)),
                new NetNamedPipeBinding(),
                new EndpointAddress("net.pipe://localhost/TabularPushService"));

As quoted by MSDN , hereby this is the cited one:

Defines a binding that is secure, reliable, optimized for on-machine cross process communication. By default, it generates a runtime communication stack with WS-ReliableMessaging for reliability, transport security for transfer security, named pipes for message delivery, and binary message encoding.

Reference: 

<netNamedPipeBinding>


转载于:https://my.oschina.net/u/854138/blog/134186

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值