0
0
Fork 0
mirror of https://github.com/ryujinx-mirror/ryujinx.git synced 2024-10-19 22:21:40 +00:00
ryujinx-fork/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/Types/AddrInfo4.cs
gdkchan 0b1185284c
Fix GetAddrInfoWithOptions and some sockets issues (#2936)
* Fix GetAddrInfoWithOptions and some sockets issues

* Was not supposed to remove this log
2021-12-26 15:17:13 +01:00

29 lines
No EOL
791 B
C#

using Ryujinx.Common.Memory;
using System;
using System.Net;
using System.Net.Sockets;
using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres.Types
{
[StructLayout(LayoutKind.Sequential, Pack = 1, Size = 0x10)]
struct AddrInfo4
{
public byte Length;
public byte Family;
public short Port;
public Array4<byte> Address;
public AddrInfo4(IPAddress address, short port)
{
Length = 0;
Family = (byte)AddressFamily.InterNetwork;
Port = port;
Address = default;
Span<byte> outAddress = Address.ToSpan();
address.TryWriteBytes(outAddress, out _);
outAddress.Reverse();
}
}
}