+ public override Task FlushAsync(CancellationToken cancellationToken);
+ public override int Read(byte[] buffer, int offset, int size);
+ public override Task<int> ReadAsync(byte[] buffer, int offset, int size, CancellationToken cancellationToken);
+ public override long Seek(long offset, SeekOrigin origin);
+ public override void SetLength(long value);
+ public override void Write(byte[] buffer, int offset, int size);
+ public override Task WriteAsync(byte[] buffer, int offset, int size, CancellationToken cancellationToken);
+ }
+ public enum ProtocolType {
+ Ggp = 3,
+ Icmp = 1,
+ IcmpV6 = 58,
+ Idp = 22,
+ Igmp = 2,
+ IP = 0,
+ IPSecAuthenticationHeader = 51,
+ IPSecEncapsulatingSecurityPayload = 50,
+ IPv4 = 4,
+ IPv6 = 41,
+ IPv6DestinationOptions = 60,
+ IPv6FragmentHeader = 44,
+ IPv6HopByHopOptions = 0,
+ IPv6NoNextHeader = 59,
+ IPv6RoutingHeader = 43,
+ Ipx = 1000,
+ ND = 77,
+ Pup = 12,
+ Raw = 255,
+ Spx = 1256,
+ SpxII = 1257,
+ Tcp = 6,
+ Udp = 17,
+ Unknown = -1,
+ Unspecified = 0,
+ }
+ public enum SelectMode {
+ SelectError = 2,
+ SelectRead = 0,
+ SelectWrite = 1,
+ }
+ public class SendPacketsElement {
+ public SendPacketsElement(byte[] buffer);
+ public SendPacketsElement(byte[] buffer, int offset, int count);
+ public SendPacketsElement(byte[] buffer, int offset, int count, bool endOfPacket);
+ public SendPacketsElement(string filepath);
+ public SendPacketsElement(string filepath, int offset, int count);
+ public SendPacketsElement(string filepath, int offset, int count, bool endOfPacket);
+ public byte[] Buffer { get; }
+ public int Count { get; }
+ public bool EndOfPacket { get; }
+ public string FilePath { get; }
+ public int Offset { get; }
+ }
+ public class Socket : IDisposable {
+ public Socket(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType);
+ public Socket(SocketType socketType, ProtocolType protocolType);
+ public AddressFamily AddressFamily { get; }
+ public int Available { get; }
+ public bool Blocking { get; set; }
+ public bool Connected { get; }
+ public bool DontFragment { get; set; }
+ public bool DualMode { get; set; }
+ public bool EnableBroadcast { get; set; }
+ public bool ExclusiveAddressUse { get; set; }
+ public bool IsBound { get; }
+ public LingerOption LingerState { get; set; }
+ public EndPoint LocalEndPoint { get; }
+ public bool MulticastLoopback { get; set; }
+ public bool NoDelay { get; set; }
+ public static bool OSSupportsIPv4 { get; }
+ public static bool OSSupportsIPv6 { get; }
+ public ProtocolType ProtocolType { get; }
+ public int ReceiveBufferSize { get; set; }
+ public int ReceiveTimeout { get; set; }
+ public EndPoint RemoteEndPoint { get; }
+ public int SendBufferSize { get; set; }
+ public int SendTimeout { get; set; }
+ public SocketType SocketType { get; }
+ public short Ttl { get; set; }
+ public Socket Accept();
+ public bool AcceptAsync(SocketAsyncEventArgs e);
+ public void Bind(EndPoint localEP);
+ public static void CancelConnectAsync(SocketAsyncEventArgs e);
+ public void Connect(EndPoint remoteEP);
+ public void Connect(IPAddress address, int port);
+ public void Connect(IPAddress[] addresses, int port);
+ public void Connect(string host, int port);
+ public bool ConnectAsync(SocketAsyncEventArgs e);
+ public static bool ConnectAsync(SocketType socketType, ProtocolType protocolType, SocketAsyncEventArgs e);
+ public void Dispose();
+ protected virtual void Dispose(bool disposing);
+ ~Socket();
+ public object GetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName);
+ public void GetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, byte[] optionValue);
+ public byte[] GetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, int optionLength);
+ public int IOControl(int ioControlCode, byte[] optionInValue, byte[] optionOutValue);
+ public int IOControl(IOControlCode ioControlCode, byte[] optionInValue, byte[] optionOutValue);
+ public void Listen(int backlog);
+ public bool Poll(int microSeconds, SelectMode mode);
+ public int Receive(byte[] buffer);
+ public int Receive(byte[] buffer, int offset, int size, SocketFlags socketFlags);
+ public int Receive(byte[] buffer, int offset, int size, SocketFlags socketFlags, out SocketError errorCode);
+ public int Receive(byte[] buffer, int size, SocketFlags socketFlags);
+ public int Receive(byte[] buffer, SocketFlags socketFlags);
+ public int Receive(IList<ArraySegment<byte>> buffers);
+ public int Receive(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags);
+ public int Receive(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode);
+ public bool ReceiveAsync(SocketAsyncEventArgs e);
+ public int ReceiveFrom(byte[] buffer, int offset, int size, SocketFlags socketFlags, ref EndPoint remoteEP);
+ public int ReceiveFrom(byte[] buffer, int size, SocketFlags socketFlags, ref EndPoint remoteEP);
+ public int ReceiveFrom(byte[] buffer, ref EndPoint remoteEP);
+ public int ReceiveFrom(byte[] buffer, SocketFlags socketFlags, ref EndPoint remoteEP);
+ public bool ReceiveFromAsync(SocketAsyncEventArgs e);
+ public int ReceiveMessageFrom(byte[] buffer, int offset, int size, ref SocketFlags socketFlags, ref EndPoint remoteEP, out IPPacketInformation ipPacketInformation);
+ public bool ReceiveMessageFromAsync(SocketAsyncEventArgs e);
+ public static void Select(IList checkRead, IList checkWrite, IList checkError, int microSeconds);
+ public int Send(byte[] buffer);
+ public int Send(byte[] buffer, int offset, int size, SocketFlags socketFlags);
+ public int Send(byte[] buffer, int offset, int size, SocketFlags socketFlags, out SocketError errorCode);
+ public int Send(byte[] buffer, int size, SocketFlags socketFlags);
+ public int Send(byte[] buffer, SocketFlags socketFlags);
+ public int Send(IList<ArraySegment<byte>> buffers);
+ public int Send(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags);
+ public int Send(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode);
+ public bool SendAsync(SocketAsyncEventArgs e);
+ public bool SendPacketsAsync(SocketAsyncEventArgs e);
+ public int SendTo(byte[] buffer, int offset, int size, SocketFlags socketFlags, EndPoint remoteEP);
+ public int SendTo(byte[] buffer, int size, SocketFlags socketFlags, EndPoint remoteEP);
+ public int SendTo(byte[] buffer, EndPoint remoteEP);
+ public int SendTo(byte[] buffer, SocketFlags socketFlags, EndPoint remoteEP);
+ public bool SendToAsync(SocketAsyncEventArgs e);
+ public void SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, bool optionValue);
+ public void SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, byte[] optionValue);
+ public void SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, int optionValue);
+ public void SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, object optionValue);
+ public void Shutdown(SocketShutdown how);
+ }
+ public class SocketAsyncEventArgs : EventArgs, IDisposable {
+ public SocketAsyncEventArgs();
+ public Socket AcceptSocket { get; set; }
+ public byte[] Buffer { get; }
+ public IList<ArraySegment<byte>> BufferList { get; set; }
+ public int BytesTransferred { get; }
+ public Exception ConnectByNameError { get; }
+ public Socket ConnectSocket { get; }
+ public int Count { get; }
+ public SocketAsyncOperation LastOperation { get; }
+ public int Offset { get; }
+ public IPPacketInformation ReceiveMessageFromPacketInfo { get; }
+ public EndPoint RemoteEndPoint { get; set; }
+ public SendPacketsElement[] SendPacketsElements { get; set; }
+ public int SendPacketsSendSize { get; set; }
+ public SocketError SocketError { get; set; }
+ public SocketFlags SocketFlags { get; set; }
+ public object UserToken { get; set; }
+ public event EventHandler<SocketAsyncEventArgs> Completed;