Class ChannelBase
Defines a base implementation for servers and their clients over a single kind of communication channel.
Inheritance
Namespace:Microsoft.SqlTools.ServiceLayer.Hosting.Protocol.Channel
Assembly:Microsoft.SqlTools.ServiceLayer.dll
Syntax
public abstract class ChannelBase
Properties
| Improve this Doc View SourceIsConnected
Gets a boolean that is true if the channel is connected or false if not.
Declaration
public bool IsConnected { get; protected set; }
Type | Description |
---|---|
System.Boolean |
MessageReader
Gets the MessageReader for reading messages from the channel.
Declaration
public MessageReader MessageReader { get; protected set; }
Type | Description |
---|---|
MessageReader |
MessageWriter
Gets the MessageWriter for writing messages to the channel.
Declaration
public MessageWriter MessageWriter { get; protected set; }
Type | Description |
---|---|
MessageWriter |
Methods
| Improve this Doc View SourceInitialize(IMessageSerializer)
A method to be implemented by subclasses to handle the actual initialization of the channel and the creation and assignment of the MessageReader and MessageWriter properties.
Declaration
protected abstract void Initialize(IMessageSerializer messageSerializer)
Parameters
Type | Name | Description |
---|---|---|
IMessageSerializer | messageSerializer | The IMessageSerializer to use for message serialization. |
Shutdown()
A method to be implemented by subclasses to handle shutdown of the channel once Stop is called.
Declaration
protected abstract void Shutdown()
Start(MessageProtocolType)
Starts the channel and initializes the MessageDispatcher.
Declaration
public void Start(MessageProtocolType messageProtocolType)
Parameters
Type | Name | Description |
---|---|---|
MessageProtocolType | messageProtocolType | The type of message protocol used by the channel. |
Stop()
Stops the channel.
Declaration
public void Stop()
WaitForConnection()
Returns a Task that allows the consumer of the ChannelBase implementation to wait until a connection has been made to the opposite endpoint whether it's a client or server.
Declaration
public abstract Task WaitForConnection()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task to be awaited until a connection is made. |