TcpTransportBindingElement.PortSharingEnabled 属性

定义

获取或设置一个值,该值指示是否为此连接启用 TCP 端口共享。

public:
 property bool PortSharingEnabled { bool get(); void set(bool value); };
public bool PortSharingEnabled { get; set; }
member this.PortSharingEnabled : bool with get, set
Public Property PortSharingEnabled As Boolean

属性值

如果启用 TCP 端口共享,则为 true;否则为 false。 默认值是 false

示例

下面的示例演示如何获取一个指示是否启用 TCP 端口共享的值。

bool portSharingEnabled = bElement.PortSharingEnabled;

注解

使用此设置需要通过将其启动类型更改为“手动”或“自动”来启用 WCF TCP 端口共享服务。

有关 TCP 侦听器以及如何启动它的信息,请参阅 Net.TCP 端口共享

适用于