#nullable enable using System; using System.Net.Sockets; using System.Threading; using System.Threading.Tasks; using Renci.SshNet.Common; namespace Renci.SshNet { /// /// Serves as base class for client implementations, provides common client functionality. /// public interface IBaseClient : IDisposable { /// /// Gets the connection info. /// /// /// The connection info. /// /// The method was called after the client was disposed. ConnectionInfo ConnectionInfo { get; } /// /// Gets a value indicating whether this client is connected to the server. /// /// /// if this client is connected; otherwise, . /// /// The method was called after the client was disposed. bool IsConnected { get; } /// /// Gets or sets the keep-alive interval. /// /// /// The keep-alive interval. Specify negative one (-1) milliseconds to disable the /// keep-alive. This is the default value. /// /// The method was called after the client was disposed. TimeSpan KeepAliveInterval { get; set; } /// /// Occurs when an error occurred. /// event EventHandler ErrorOccurred; /// /// Occurs when host key received. /// event EventHandler HostKeyReceived; /// /// Occurs when server identification received. /// event EventHandler? ServerIdentificationReceived; /// /// Connects client to the server. /// /// The client is already connected. /// The method was called after the client was disposed. /// Socket connection to the SSH server or proxy server could not be established, or an error occurred while resolving the hostname. /// SSH session could not be established. /// Authentication of SSH session failed. /// Failed to establish proxy connection. void Connect(); /// /// Asynchronously connects client to the server. /// /// The to observe. /// A that represents the asynchronous connect operation. /// /// The client is already connected. /// The method was called after the client was disposed. /// Socket connection to the SSH server or proxy server could not be established, or an error occurred while resolving the hostname. /// SSH session could not be established. /// Authentication of SSH session failed. /// Failed to establish proxy connection. Task ConnectAsync(CancellationToken cancellationToken); /// /// Disconnects client from the server. /// /// The method was called after the client was disposed. void Disconnect(); /// /// Sends a keep-alive message to the server. /// /// /// Use to configure the client to send a keep-alive at regular /// intervals. /// /// The method was called after the client was disposed. void SendKeepAlive(); } }