aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/ISocket.cs
blob: fe2f8477faab55ccc7c33b203af591a5219b6788 (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 : 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();
    }
}