ListenUriMode ListenUriMode ListenUriMode ListenUriMode Enum

定义

指示传输是否必须保证提供给服务的供服务侦听的 URI 是唯一的,或者不对该 URI 进行任何修改,就原样使用。Indicates whether the transport must ensure that the URI provided for the service to listen on is unique or can be used exactly as provided.

public enum class ListenUriMode
public enum ListenUriMode
type ListenUriMode = 
Public Enum ListenUriMode
继承
ListenUriModeListenUriModeListenUriModeListenUriMode

字段

Explicit Explicit Explicit Explicit 0

完全原样使用 ListenUriUses the ListenUri exactly as provided. 这是默认值。This is the default value.

Unique Unique Unique Unique 1

指定传输是否应使用特定传输机制,以确保 ListenUri 是唯一的。Specifies that the transport should use a transport-specific mechanism to ensure that the ListenUri is unique.

注解

可以使用 ListenUri 属性,以编程方式对服务要侦听的终结点的 URI 进行设置;还可以使用 ListenUriMode 属性来设置该终结点的 ListenUriMode 的值。The URI for the endpoint on which a service listens can be set programmatically using the ListenUri property and the value of the ListenUriMode for that endpoint is set using the ListenUriMode property. ListenUri 的默认值为 AddressThe default value for ListenUri is Address. 默认值为ListenUriMode为显性。The default value for ListenUriMode is Explicit.

另外,也可使用 ListenUri 属性和 ListenUriMode 属性来设置这些属性的值。The value of these properties may also be set using the ListenUri property and the ListenUriMode property.

时的值ListenUriMode设置为 Unique 传输协议是负责创建一个唯一的 URI。When the value of the ListenUriMode is set to Unique the transport is responsible for creating a unique URI. 使用 Windows Communication Foundation (WCF) 的不同传输以不同的方式生成此唯一 URIDifferent transports used by Windows Communication Foundation (WCF) generate this unique URI differently

  • 对于独占模式下的 TCP(PortSharingEnabledfalse),这意味着绑定到一个唯一可用端口号。For TCP in exclusive mode (PortSharingEnabled is false) this means binding to a uniquely available port number.

  • 对于 TCP 端口共享模式 (PortSharingEnabledtrue) 和对于所有其他现有 WCF 传输,这意味着将唯一路径 (GUID) 追加到末尾ListenUriFor TCP in port sharing mode (PortSharingEnabled is true) and for all of the other existing WCF transports, this means appending a unique path (a GUID) to the end of the ListenUri.

时的值ListenUriMode设置为显式模式下,传输使用ListenUri原样提供,而无需修改它,使其唯一。When the value of the ListenUriMode is set to Explicit mode, the transport uses the ListenUri exactly as it is provided, without modifying it to make it unique.

适用于