aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/ISocket.cs
blob: 058748685d1b9f8fb901125eaca56d1dd77d1e0b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using Ryujinx.HLE.HOS.Services.Sockets.Bsd.Types;
using System;
using System.Net;
using System.Net.Sockets;

namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
{
    interface ISocket : IDisposable, IFileDescriptor
    {
        IPEndPoint RemoteEndPoint { get; }
        IPEndPoint LocalEndPoint { get; }

        AddressFamily AddressFamily { get; }

        SocketType SocketType { get; }

        ProtocolType ProtocolType { get; }

        IntPtr Handle { get; }

        LinuxError Receive(out int receiveSize, Span<byte> buffer, BsdSocketFlags flags);

        LinuxError ReceiveFrom(out int receiveSize, Span<byte> buffer, int size, BsdSocketFlags flags, out IPEndPoint remoteEndPoint);

        LinuxError Send(out int sendSize, ReadOnlySpan<byte> buffer, BsdSocketFlags flags);

        LinuxError SendTo(out int sendSize, ReadOnlySpan<byte> buffer, int size, BsdSocketFlags flags, IPEndPoint remoteEndPoint);

        LinuxError RecvMMsg(out int vlen, BsdMMsgHdr message, BsdSocketFlags flags, TimeVal timeout);

        LinuxError SendMMsg(out int vlen, BsdMMsgHdr message, BsdSocketFlags flags);

        LinuxError GetSocketOption(BsdSocketOption option, SocketOptionLevel level, Span<byte> optionValue);

        LinuxError SetSocketOption(BsdSocketOption option, SocketOptionLevel level, ReadOnlySpan<byte> optionValue);

        bool Poll(int microSeconds, SelectMode mode);

        LinuxError Bind(IPEndPoint localEndPoint);

        LinuxError Connect(IPEndPoint remoteEndPoint);

        LinuxError Listen(int backlog);

        LinuxError Accept(out ISocket newSocket);

        void Disconnect();

        LinuxError Shutdown(BsdSocketShutdownFlags how);

        void Close();
    }
}