ISocket.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 RecvMMsg(out int vlen, BsdMMsgHdr message, BsdSocketFlags flags, TimeVal timeout);
  19. LinuxError SendMMsg(out int vlen, BsdMMsgHdr message, BsdSocketFlags flags);
  20. LinuxError GetSocketOption(BsdSocketOption option, SocketOptionLevel level, Span<byte> optionValue);
  21. LinuxError SetSocketOption(BsdSocketOption option, SocketOptionLevel level, ReadOnlySpan<byte> optionValue);
  22. bool Poll(int microSeconds, SelectMode mode);
  23. LinuxError Bind(IPEndPoint localEndPoint);
  24. LinuxError Connect(IPEndPoint remoteEndPoint);
  25. LinuxError Listen(int backlog);
  26. LinuxError Accept(out ISocket newSocket);
  27. void Disconnect();
  28. LinuxError Shutdown(BsdSocketShutdownFlags how);
  29. void Close();
  30. }
  31. }