开发者

How to disable reliable session in netNamedPipeBinding in WCF?

开发者_如何学JAVAHow do I disable reliable sessions in a named pipe binding?


Named Pipe doesn't support reliable session configuration. You'd need to create a custom binding.

More info at Reliable Sessions Overview


Before opening the host, set the Contract.SessionMode to SessionMode.Allowed when using a named pipe binding

// 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();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜