다음을 통해 공유


ChannelDispatcher.Listener 속성

정의

채널 디스패처에 연결된 수신기를 가져옵니다.

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

속성 값

IChannelListener

채널 디스패처에 연결된 IChannelListener입니다.

예제

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];
IChannelListener listener = dispatcher.Listener;
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 listener As IChannelListener = dispatcher.Listener

설명

ChannelDispatcher는 특정 URI의 IChannelListener를 서비스 인스턴스에 연결합니다.

적용 대상