This documentation is archived and is not being maintained.

ChannelBase Class

Provides the base implementation for custom channels.

Namespace:  System.ServiceModel.Channels
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public abstract class ChannelBase : CommunicationObject, 
	IChannel, ICommunicationObject, IDefaultCommunicationTimeouts

The ChannelBase class provides an abstract base class implementation of the IChannel interface. It also requires that each channel be associated with a channel manager. Note that the only constructor available for creating instances of ChannelBase requires a channelManager input parameter.

State changes are managed by inheriting from the CommunicationObject implementation of the state machine.

The ChannelBase gets its default communication timeouts for the open, close, send and receive operations from the ChannelManagerBase associated with it.

The ChannelBase also manages the manager for you. In addition to exposing a reference to the manager, the base class also notifies the manager when channels are created and destroyed. But the reference to the manager is only good until the channel is destroyed.

Even if you do use the base class, you must still provide behaviors for opening and closing the channel. The default implementations of these methods do not provide useful information.

You must also make sure to override GetProperty<T> whenever you implement a channel. GetProperty<T> is an excellent way to communicate information along the channel stack without having to know what channels are below you, or what channels above you may perform queries. Define interfaces that can be queried for available information. Whenever you do not recognize the type argument for GetProperty<T>, delegate down to the next channel in the stack or return null if you are creating a new transport channel at the bottom of the stack.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0

.NET Compact Framework

Supported in: 3.5