开发者

How to disable reliable session in netNamedPipeBinding in WCF?

开发者 https://www.devze.com 2022-12-28 03:16 出处:网络
开发者_如何学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.

开发者_如何学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

精彩评论

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

关注公众号