ISocket.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using System;
  2. using System.Net;
  3. using System.Net.Sockets;
  4. namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
  5. {
  6. interface ISocket : IDisposable, IFileDescriptor
  7. {
  8. IPEndPoint RemoteEndPoint { get; }
  9. IPEndPoint LocalEndPoint { get; }
  10. AddressFamily AddressFamily { get; }
  11. SocketType SocketType { get; }
  12. ProtocolType ProtocolType { get; }
  13. IntPtr Handle { get; }
  14. LinuxError Receive(out int receiveSize, Span<byte> buffer, BsdSocketFlags flags);
  15. LinuxError ReceiveFrom(out int receiveSize, Span<byte> buffer, int size, BsdSocketFlags flags, out IPEndPoint remoteEndPoint);
  16. LinuxError Send(out int sendSize, ReadOnlySpan<byte> buffer, BsdSocketFlags flags);
  17. LinuxError SendTo(out int sendSize, ReadOnlySpan<byte> buffer, int size, BsdSocketFlags flags, IPEndPoint remoteEndPoint);
  18. LinuxError GetSocketOption(BsdSocketOption option, SocketOptionLevel level, Span<byte> optionValue);
  19. LinuxError SetSocketOption(BsdSocketOption option, SocketOptionLevel level, ReadOnlySpan<byte> optionValue);
  20. bool Poll(int microSeconds, SelectMode mode);
  21. LinuxError Bind(IPEndPoint localEndPoint);
  22. LinuxError Connect(IPEndPoint remoteEndPoint);
  23. LinuxError Listen(int backlog);
  24. LinuxError Accept(out ISocket newSocket);
  25. void Disconnect();
  26. LinuxError Shutdown(BsdSocketShutdownFlags how);
  27. void Close();
  28. }
  29. }