Wednesday, December 07, 2005

Programmatic Channel Registration

A remoting channel is any component that implements the IChannel interface. Both the client and the host application need to register which channels they wish to use, using the static method RegisterChannel of the ChannelServices class.

Host channels registration


The host must register at least one channel if it wants to export objects.

// Register TCP channel
IChannel channel = new TcpChannel(8005);
ChannelServices.RegisterChannel(channel);

// Register HTTP channel
IChannel channel = new HttpChannel(8006);
ChannelServices.RegisterChannel(channel);


LandVP LLC

No comments: