using System; using System.IO; using System.Net; using System.Net.Sockets; using System.Security.Authentication; using System.Security.Cryptography.X509Certificates; using System.Threading.Tasks; namespace Fleck { public interface ISocket { bool Connected { get; } string RemoteIpAddress { get; } int RemotePort { get; } Stream Stream { get; } bool NoDelay { get; set; } EndPoint LocalEndPoint { get; } Task Accept(Action callback, Action error); Task Send(byte[] buffer, Action callback, Action error); Task Receive(byte[] buffer, Action callback, Action error, int offset = 0); Task Authenticate(X509Certificate2 certificate, SslProtocols enabledSslProtocols, Action callback, Action error); void Dispose(); void Close(); void Bind(EndPoint ipLocal); void Listen(int backlog); } }