방법: 프로그래밍 방식으로 채널 구성

이 항목은 이전 버전의 기존 응용 프로그램과의 호환성을 위해 유지되고 있으나 새로운 개발에는 권장되지 않는 레거시 기술에 대해 설명합니다. 분산 응용 프로그램은 이제 WCF(Windows Communication Foundation)를 사용하여 개발됩니다.

이 코드 예제에서는 서버 응용 프로그램 도메인에 대해 프로그래밍 방식으로 채널을 구성하는 방법을 보여 줍니다. 이 경우 서버는 원격 시스템에서 전송에 HttpChannel 개체를 사용하지만 serialization 및 deserialization에 BinaryFormatter 개체를 사용하도록 지정합니다.

예제

Dim props = New Hashtable() As IDictionary
props("name") = "ChannelName1" 
Dim channel As New HttpChannel( _
   props, _
   Nothing, _
   New BinaryServerFormatterSinkProvider() _
)
ChannelServices.RegisterChannel(channel)
IDictionary props = new Hashtable();
props["name"] = "MyHttpChannel";
HttpChannel channel = new HttpChannel(
   props, 
   null, 
   new BinaryServerFormatterSinkProvider()
);
ChannelServices.RegisterChannel(channel);

참고 항목

개념

채널 및 포맷터 구성 속성

빌드 날짜: 2010-02-13