Supercell.GUT/Supercell.GUT.Server/Network/Tcp/SocketExtensions.cs
BreadDEV ad23f95319 [v0.0.1] very early state server
only basic messages, wip.
2024-03-04 20:19:32 +07:00

17 lines
401 B
C#

using System.Net.Sockets;
namespace Supercell.GUT.Server.Network.Tcp;
internal static class SocketExtensions
{
public static async ValueTask<Socket?> AcceptSocketAsync(this Socket socket, CancellationToken ct)
{
try
{
return await socket.AcceptAsync(ct);
}
catch (OperationCanceledException)
{
return null;
}
}
}