代码之家  ›  专栏  ›  技术社区  ›  Rohit

如何在wcf中禁用netnamedpipebinding中的可靠会话?

  •  1
  • Rohit  · 技术社区  · 16 年前

    如何在命名管道绑定中禁用可靠会话?

    2 回复  |  直到 13 年前
        1
  •  0
  •   Vitalik    16 年前

    命名管道不支持可靠的会话配置。您需要创建自定义绑定。

    更多信息 Reliable Sessions Overview

        2
  •  0
  •   j0k gauthamp    13 年前

    在打开主机之前,设置 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();
    
    推荐文章