如何在命名管道绑定中禁用可靠会话?
问问题
2845 次
2 回答
0
命名管道不支持可靠的会话配置。您需要创建一个自定义绑定。
更多信息在可靠会话概述
于 2010-04-27T19:15:10.943 回答
0
在打开主机之前,使用命名管道绑定时设置Contract.SessionMode
为SessionMode.Allowed
// create a service host with a custom endpoint based on what we know
ServiceHost host = new ServiceHost(serviceHostType);
NetNamedPipeBinding binding = new NetNamedPipeBinding();
ServiceEndpoint ep = host.AddServiceEndpoint(contractName, binding, endpoint.Uri);
ep.Contract.SessionMode = SessionMode.Allowed;
wcfServices.Add(host);
host.Open();
于 2012-08-21T23:30:28.800 回答