다음을 통해 공유


ChannelDispatcher.Host 속성

정의

디스패처에 연결된 서비스에 대한 호스트를 가져옵니다.

public:
 virtual property System::ServiceModel::ServiceHostBase ^ Host { System::ServiceModel::ServiceHostBase ^ get(); };
public override System.ServiceModel.ServiceHostBase Host { get; }
member this.Host : System.ServiceModel.ServiceHostBase
Public Overrides ReadOnly Property Host As ServiceHostBase

속성 값

ServiceHostBase

디스패처에 연결된 서비스에 대한 ServiceHostBase입니다.

예제

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];
ServiceHostBase hostBase = dispatcher.Host;
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 hostBase As ServiceHostBase = dispatcher.Host

설명

ServiceHost 개체는 해당 서비스에 대한 서로 다른 ChannelDispatcher에 연결된 여러 개의 IChannelListener 개체를 가질 수 있습니다.

적용 대상