ChannelDispatcher.Endpoints 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取将消息转发到通道终结点的终结点调度程序。
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 来获取对运行时属性的访问,使用这些属性可以在整个终结点自定义运行时。