mirror of
https://github.com/thebreaddev/Supercell.GUT.git
synced 2024-11-13 00:54:37 +00:00
ad23f95319
only basic messages, wip.
17 lines
401 B
C#
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;
|
|
}
|
|
}
|
|
}
|