ChannelDispatcher.Endpoints 屬性

定義

取得轉送訊息至通道端點的端點發送器。

public:
 property System::Collections::Generic::SynchronizedCollection<System::ServiceModel::Dispatcher::EndpointDispatcher ^> ^ Endpoints { System::Collections::Generic::SynchronizedCollection<System::ServiceModel::Dispatcher::EndpointDispatcher ^> ^ get(); };
public System.Collections.Generic.SynchronizedCollection<System.ServiceModel.Dispatcher.EndpointDispatcher> Endpoints { get; }
member this.Endpoints : System.Collections.Generic.SynchronizedCollection<System.ServiceModel.Dispatcher.EndpointDispatcher>
Public ReadOnly Property Endpoints As SynchronizedCollection(Of EndpointDispatcher)

屬性值

SynchronizedCollection<T>EndpointDispatcher,這些發送器會將訊息轉送到通道端點。

範例

Uri baseAddress = new Uri("http://localhost:8001/Simple");
ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService), baseAddress);

serviceHost.AddServiceEndpoint(
    typeof(ICalculator),
    new WSHttpBinding(),
    "CalculatorServiceObject");

serviceHost.Open();

ChannelDispatcher dispatcher = (ChannelDispatcher)serviceHost.ChannelDispatchers[0];
SynchronizedCollection<EndpointDispatcher> col = dispatcher.Endpoints;
Dim baseAddress As New Uri("http://localhost:8001/Simple")
Dim serviceHost As New ServiceHost(GetType(CalculatorService), baseAddress)

serviceHost.AddServiceEndpoint(GetType(ICalculator), New WSHttpBinding(), "CalculatorServiceObject")

serviceHost.Open()

Dim dispatcher As ChannelDispatcher = CType(serviceHost.ChannelDispatchers(0), ChannelDispatcher)
Dim col As SynchronizedCollection(Of EndpointDispatcher) = dispatcher.Endpoints

備註

ChannelDispatcher 對通道所能支援的每個端點都會使用不同的 EndpointDispatcher

使用 EndpointDispatcher,即可存取執行階段屬性,而這些屬性可讓您自訂整個端點上的執行階段。

適用於