Improve this Doc
              View Source
              
              Provides behavior for a client or server endpoint that
communicates using the specified protocol.
                Inheritance
                  System.Object
                  ProtocolEndpoint
               
              Namespace:Microsoft.SqlTools.ServiceLayer.Hosting.Protocol
              Assembly:Microsoft.SqlTools.ServiceLayer.dll
              
              
                public class ProtocolEndpoint : IProtocolEndpoint, IMessageSender
               
              Constructors
              
              
                |
                Improve this Doc
              
              
                View Source
              
              
              Initializes an instance of the protocol server using the
specified channel for communication.
Declaration
              
                public ProtocolEndpoint(ChannelBase protocolChannel, MessageProtocolType messageProtocolType)
               
              Parameters
              
                
                  
                    | Type | Name | Description | 
                
                
                  
                    | ChannelBase | protocolChannel | The channel to use for communication with the connected endpoint. | 
                  
                    | MessageProtocolType | messageProtocolType | The type of message protocol used by the endpoint. | 
                
              
              Properties
              
              
                |
                Improve this Doc
              
              
                View Source
              
              
              Gets the MessageDispatcher which allows registration of
handlers for requests, responses, and events that are
transmitted through the channel.
Declaration
              
                protected MessageDispatcher MessageDispatcher { get; set; }
               
              
              
              Methods
              
              
                |
                Improve this Doc
              
              
                View Source
              
              
              
              
              Declaration
              
                protected virtual Task OnConnect()
               
              Returns
              
                
                  
                    | Type | Description | 
                
                
                  
                    | System.Threading.Tasks.Task |  | 
                
              
              
                |
                Improve this Doc
              
              
                View Source
              
              
              
              
              Declaration
              
                protected virtual Task OnStart()
               
              Returns
              
                
                  
                    | Type | Description | 
                
                
                  
                    | System.Threading.Tasks.Task |  | 
                
              
              
                |
                Improve this Doc
              
              
                View Source
              
              
              
              
              Declaration
              
                protected virtual Task OnStop()
               
              Returns
              
                
                  
                    | Type | Description | 
                
                
                  
                    | System.Threading.Tasks.Task |  | 
                
              
              
                |
                Improve this Doc
              
              
                View Source
              
              
              Sends an event to the channel's endpoint.
Declaration
              
                public Task SendEvent<TParams>(EventType<TParams> eventType, TParams eventParams)
               
              Parameters
              
                
                  
                    | Type | Name | Description | 
                
                
                  
                    | EventType<TParams> | eventType | The type of event being sent. | 
                  
                    | TParams | eventParams | The event parameters being sent. | 
                
              
              Returns
              
                
                  
                    | Type | Description | 
                
                
                  
                    | System.Threading.Tasks.Task | A Task that tracks completion of the send operation. | 
                
              
              
                |
                Improve this Doc
              
              
                View Source
              
              
              Sends a request to the server
Declaration
              
                public Task<TResult> SendRequest<TParams, TResult>(RequestType<TParams, TResult> requestType, TParams requestParams)
               
              Parameters
              
                
                  
                    | Type | Name | Description | 
                
                
                  
                    | RequestType<TParams, TResult> | requestType |  | 
                  
                    | TParams | requestParams |  | 
                
              
              Returns
              
                
                  
                    | Type | Description | 
                
                
                  
                    | System.Threading.Tasks.Task<TResult> |  | 
                
              
              
                |
                Improve this Doc
              
              
                View Source
              
              
              
              
              Declaration
              
                public Task<TResult> SendRequest<TParams, TResult>(RequestType<TParams, TResult> requestType, TParams requestParams, bool waitForResponse)
               
              Parameters
              
                
                  
                    | Type | Name | Description | 
                
                
                  
                    | RequestType<TParams, TResult> | requestType |  | 
                  
                    | TParams | requestParams |  | 
                  
                    | System.Boolean | waitForResponse |  | 
                
              
              Returns
              
                
                  
                    | Type | Description | 
                
                
                  
                    | System.Threading.Tasks.Task<TResult> |  | 
                
              
              
                |
                Improve this Doc
              
              
                View Source
              
              SetEventHandler<TParams>(EventType<TParams>, Func<TParams, EventContext, Task>)
              
              
              Declaration
              
                public void SetEventHandler<TParams>(EventType<TParams> eventType, Func<TParams, EventContext, Task> eventHandler)
               
              Parameters
              
                
                  
                    | Type | Name | Description | 
                
                
                  
                    | EventType<TParams> | eventType |  | 
                  
                    | System.Func<TParams, EventContext, System.Threading.Tasks.Task> | eventHandler |  | 
                
              
              
                |
                Improve this Doc
              
              
                View Source
              
              SetEventHandler<TParams>(EventType<TParams>, Func<TParams, EventContext, Task>, Boolean)
              
              
              Declaration
              
                public void SetEventHandler<TParams>(EventType<TParams> eventType, Func<TParams, EventContext, Task> eventHandler, bool overrideExisting)
               
              Parameters
              
                
                  
                    | Type | Name | Description | 
                
                
                  
                    | EventType<TParams> | eventType |  | 
                  
                    | System.Func<TParams, EventContext, System.Threading.Tasks.Task> | eventHandler |  | 
                  
                    | System.Boolean | overrideExisting |  | 
                
              
              
                |
                Improve this Doc
              
              
                View Source
              
              SetRequestHandler<TParams, TResult>(RequestType<TParams, TResult>, Func<TParams, RequestContext<TResult>, Task>)
              
              
              Declaration
              
                public void SetRequestHandler<TParams, TResult>(RequestType<TParams, TResult> requestType, Func<TParams, RequestContext<TResult>, Task> requestHandler)
               
              Parameters
              
                
                  
                    | Type | Name | Description | 
                
                
                  
                    | RequestType<TParams, TResult> | requestType |  | 
                  
                    | System.Func<TParams, RequestContext<TResult>, System.Threading.Tasks.Task> | requestHandler |  | 
                
              
              
                |
                Improve this Doc
              
              
                View Source
              
              
              Starts the language server client and sends the Initialize method.
Declaration
              
              Returns
              
                
                  
                    | Type | Description | 
                
                
                  
                    | System.Threading.Tasks.Task | A Task that can be awaited for initialization to complete. | 
                
              
              
                |
                Improve this Doc
              
              
                View Source
              
              
              
              
              Declaration
              
              Returns
              
                
                  
                    | Type | Description | 
                
                
                  
                    | System.Threading.Tasks.Task |  | 
                
              
              
                |
                Improve this Doc
              
              
                View Source
              
              
              
              
              Declaration
              
                public void WaitForExit()