Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new Task-based socket methods for UDP and reimplement existing ones using SocketAsyncEventArgs #47229

Merged
merged 48 commits into from
Jan 27, 2021
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
f22e8e8
SendToAsync
Aug 28, 2020
6b07fb2
better tests
Aug 28, 2020
cdade75
fix SendToAsync cancellation
Aug 31, 2020
5345d55
implement ReceiveFromAsync
Sep 1, 2020
45f5544
ReceiveMessageFrom, WIP
Sep 1, 2020
09c8cf9
add public overload
Sep 1, 2020
a640214
proper cancellation
Sep 1, 2020
0e80b56
Merge branch 'sockettask' into sandbox/socket-experiments-01
antonfirsov Oct 27, 2020
0a93d3a
Merge branch 'master' into sandbox/socket-experiments-01
antonfirsov Oct 30, 2020
73654e9
Merge branch 'master' into sandbox/socket-experiments-01
antonfirsov Nov 3, 2020
935d7bb
WrapExceptionsInNetworkExceptions -> WrapExceptionsForNetworkStream
antonfirsov Nov 3, 2020
4fedf3a
Merge branch 'master' into sandbox/socket-experiments-01
antonfirsov Jan 11, 2021
40542fb
Merge branch 'master' into sandbox/socket-experiments-01
antonfirsov Jan 15, 2021
614287b
SocketHelperCancellableTask: pick the new overloads
antonfirsov Jan 15, 2021
01b4d75
use SocketHelperCancellableTask in SendTo/Receive(Message)From tests
antonfirsov Jan 15, 2021
2b76fda
Dedicated tests for ReceiveFrom variants
antonfirsov Jan 15, 2021
9fce395
ReceiveFrom cancellation test
antonfirsov Jan 15, 2021
bcda996
Reformat SendTo tests
antonfirsov Jan 15, 2021
77d8832
TestTimes
antonfirsov Jan 15, 2021
1328bee
SendTo cancellation tests
antonfirsov Jan 19, 2021
31e1168
ReceiveMessageFrom cancellation test
antonfirsov Jan 19, 2021
295b3d2
SendToAsync: handle pre-cancellation
antonfirsov Jan 19, 2021
17a255f
Disposed_Throws
antonfirsov Jan 19, 2021
f39c94f
move new methods to Socket class
antonfirsov Jan 19, 2021
3ba53c1
add xmdoc comments
antonfirsov Jan 19, 2021
aa1bf42
improve reliability of cancellation tests
antonfirsov Jan 19, 2021
4e4add1
fix ReceiveMessageFrom cancellation on Windows
antonfirsov Jan 19, 2021
42d0cca
add comments to SendTo cancellation test
antonfirsov Jan 19, 2021
aa08745
update comments
antonfirsov Jan 19, 2021
19f3efc
Fix single/multibuffer handling in DoOperationReceiveMessageFrom
antonfirsov Jan 21, 2021
5298475
ReceiveFrom: tests for shutdown/close/dispose cases
antonfirsov Jan 21, 2021
85915a3
Use TCP for shutdown() tests
antonfirsov Jan 21, 2021
ecd0966
Revert "Use TCP for shutdown() tests"
antonfirsov Jan 21, 2021
8bbe135
make UDP Shutdown tests [PlatformSpecific]
antonfirsov Jan 21, 2021
9805646
ReceiveMessageFrom: Close/Dispose/Shutdown tests
antonfirsov Jan 21, 2021
9baa843
TCP tests for ReceiveFrom & ReceiveMessageFrom
antonfirsov Jan 21, 2021
c5191b0
ReceiveMessageFrom + TCP test should be [PlatformSpecific]
antonfirsov Jan 21, 2021
f3a7396
attempt to stabilize tests
antonfirsov Jan 21, 2021
3901fd1
remove unnecessary $
antonfirsov Jan 21, 2021
b2b893d
Workaround for #47335
antonfirsov Jan 22, 2021
5b00ee6
better timeout handling
antonfirsov Jan 22, 2021
a345332
ignore synchronous Dispose tests on Mac (#47342)
antonfirsov Jan 22, 2021
52ebf91
update workaround in ReceiveSent_TCP_Success
antonfirsov Jan 22, 2021
6237c31
fix ReceiveFrom.ReceiveSent_TCP_Success, finetune SebdTo.CancelDuring…
antonfirsov Jan 25, 2021
fd555be
Merge branch 'master' into socket/udp-tasks
antonfirsov Jan 25, 2021
6f43cb2
delete CancelDuringOperation_Throws
antonfirsov Jan 25, 2021
c1bd86a
Trying to workaround #47469 with a delay
antonfirsov Jan 26, 2021
b2f6634
SendToBase<T> -> SendTo<T>
antonfirsov Jan 27, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/libraries/System.Net.Sockets/ref/System.Net.Sockets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,11 @@ public void Listen(int backlog) { }
public int ReceiveFrom(byte[] buffer, ref System.Net.EndPoint remoteEP) { throw null; }
public int ReceiveFrom(byte[] buffer, System.Net.Sockets.SocketFlags socketFlags, ref System.Net.EndPoint remoteEP) { throw null; }
public System.Threading.Tasks.Task<System.Net.Sockets.SocketReceiveFromResult> ReceiveFromAsync(System.ArraySegment<byte> buffer, System.Net.Sockets.SocketFlags socketFlags, System.Net.EndPoint remoteEndPoint) { throw null; }
public System.Threading.Tasks.ValueTask<System.Net.Sockets.SocketReceiveFromResult> ReceiveFromAsync(System.Memory<byte> buffer, System.Net.Sockets.SocketFlags socketFlags, System.Net.EndPoint remoteEndPoint, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public bool ReceiveFromAsync(System.Net.Sockets.SocketAsyncEventArgs e) { throw null; }
public int ReceiveMessageFrom(byte[] buffer, int offset, int size, ref System.Net.Sockets.SocketFlags socketFlags, ref System.Net.EndPoint remoteEP, out System.Net.Sockets.IPPacketInformation ipPacketInformation) { throw null; }
public System.Threading.Tasks.Task<System.Net.Sockets.SocketReceiveMessageFromResult> ReceiveMessageFromAsync(System.ArraySegment<byte> buffer, System.Net.Sockets.SocketFlags socketFlags, System.Net.EndPoint remoteEndPoint) { throw null; }
public System.Threading.Tasks.ValueTask<System.Net.Sockets.SocketReceiveMessageFromResult> ReceiveMessageFromAsync(System.Memory<byte> buffer, System.Net.Sockets.SocketFlags socketFlags, System.Net.EndPoint remoteEndPoint, System.Threading.CancellationToken cancellationToken = default) { throw null; }
public bool ReceiveMessageFromAsync(System.Net.Sockets.SocketAsyncEventArgs e) { throw null; }
public static void Select(System.Collections.IList? checkRead, System.Collections.IList? checkWrite, System.Collections.IList? checkError, int microSeconds) { }
public int Send(byte[] buffer) { throw null; }
Expand All @@ -409,6 +411,7 @@ public void SendFile(string? fileName, byte[]? preBuffer, byte[]? postBuffer, Sy
public int SendTo(byte[] buffer, System.Net.EndPoint remoteEP) { throw null; }
public int SendTo(byte[] buffer, System.Net.Sockets.SocketFlags socketFlags, System.Net.EndPoint remoteEP) { throw null; }
public System.Threading.Tasks.Task<int> SendToAsync(System.ArraySegment<byte> buffer, System.Net.Sockets.SocketFlags socketFlags, System.Net.EndPoint remoteEP) { throw null; }
public System.Threading.Tasks.ValueTask<int> SendToAsync(System.ReadOnlyMemory<byte> buffer, System.Net.Sockets.SocketFlags socketFlags, System.Net.EndPoint remoteEP, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public bool SendToAsync(System.Net.Sockets.SocketAsyncEventArgs e) { throw null; }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public void SetIPProtectionLevel(System.Net.Sockets.IPProtectionLevel level) { }
Expand Down
272 changes: 228 additions & 44 deletions src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs

Large diffs are not rendered by default.

18 changes: 12 additions & 6 deletions src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3227,7 +3227,9 @@ private bool ReceiveAsync(SocketAsyncEventArgs e, CancellationToken cancellation
return socketError == SocketError.IOPending;
}

public bool ReceiveFromAsync(SocketAsyncEventArgs e)
public bool ReceiveFromAsync(SocketAsyncEventArgs e) => ReceiveFromAsync(e, default);

private bool ReceiveFromAsync(SocketAsyncEventArgs e, CancellationToken cancellationToken)
{
ThrowIfDisposed();

Expand Down Expand Up @@ -3261,7 +3263,7 @@ public bool ReceiveFromAsync(SocketAsyncEventArgs e)
SocketError socketError;
try
{
socketError = e.DoOperationReceiveFrom(_handle);
socketError = e.DoOperationReceiveFrom(_handle, cancellationToken);
}
catch
{
Expand All @@ -3274,7 +3276,9 @@ public bool ReceiveFromAsync(SocketAsyncEventArgs e)
return pending;
}

public bool ReceiveMessageFromAsync(SocketAsyncEventArgs e)
public bool ReceiveMessageFromAsync(SocketAsyncEventArgs e) => ReceiveMessageFromAsync(e, default);

private bool ReceiveMessageFromAsync(SocketAsyncEventArgs e, CancellationToken cancellationToken)
{
ThrowIfDisposed();

Expand Down Expand Up @@ -3310,7 +3314,7 @@ public bool ReceiveMessageFromAsync(SocketAsyncEventArgs e)
SocketError socketError;
try
{
socketError = e.DoOperationReceiveMessageFrom(this, _handle);
socketError = e.DoOperationReceiveMessageFrom(this, _handle, cancellationToken);
}
catch
{
Expand Down Expand Up @@ -3384,7 +3388,9 @@ public bool SendPacketsAsync(SocketAsyncEventArgs e)
return socketError == SocketError.IOPending;
}

public bool SendToAsync(SocketAsyncEventArgs e)
public bool SendToAsync(SocketAsyncEventArgs e) => SendToAsync(e, default);

private bool SendToAsync(SocketAsyncEventArgs e, CancellationToken cancellationToken)
{
ThrowIfDisposed();

Expand Down Expand Up @@ -3413,7 +3419,7 @@ public bool SendToAsync(SocketAsyncEventArgs e)
SocketError socketError;
try
{
socketError = e.DoOperationSendTo(_handle);
socketError = e.DoOperationSendTo(_handle, cancellationToken);
}
catch
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1731,7 +1731,7 @@ public SocketError ReceiveMessageFrom(
return operation.ErrorCode;
}

public SocketError ReceiveMessageFromAsync(Memory<byte> buffer, IList<ArraySegment<byte>>? buffers, SocketFlags flags, byte[] socketAddress, ref int socketAddressLen, bool isIPv4, bool isIPv6, out int bytesReceived, out SocketFlags receivedFlags, out IPPacketInformation ipPacketInformation, Action<int, byte[], int, SocketFlags, IPPacketInformation, SocketError> callback)
public SocketError ReceiveMessageFromAsync(Memory<byte> buffer, IList<ArraySegment<byte>>? buffers, SocketFlags flags, byte[] socketAddress, ref int socketAddressLen, bool isIPv4, bool isIPv6, out int bytesReceived, out SocketFlags receivedFlags, out IPPacketInformation ipPacketInformation, Action<int, byte[], int, SocketFlags, IPPacketInformation, SocketError> callback, CancellationToken cancellationToken = default)
{
SetNonBlocking();

Expand All @@ -1755,7 +1755,7 @@ public SocketError ReceiveMessageFromAsync(Memory<byte> buffer, IList<ArraySegme
IsIPv6 = isIPv6,
};

if (!_receiveQueue.StartAsyncOperation(this, operation, observedSequenceNumber))
if (!_receiveQueue.StartAsyncOperation(this, operation, observedSequenceNumber, cancellationToken))
{
socketAddressLen = operation.SocketAddressLen;
receivedFlags = operation.ReceivedFlags;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ internal unsafe SocketError DoOperationReceive(SafeSocketHandle handle, Cancella
return errorCode;
}

internal unsafe SocketError DoOperationReceiveFrom(SafeSocketHandle handle)
internal unsafe SocketError DoOperationReceiveFrom(SafeSocketHandle handle, CancellationToken cancellationToken)
{
_receivedFlags = System.Net.Sockets.SocketFlags.None;
_socketAddressSize = 0;
Expand All @@ -164,7 +164,7 @@ internal unsafe SocketError DoOperationReceiveFrom(SafeSocketHandle handle)
int socketAddressLen = _socketAddress!.Size;
if (_bufferList == null)
{
errorCode = handle.AsyncContext.ReceiveFromAsync(_buffer.Slice(_offset, _count), _socketFlags, _socketAddress.Buffer, ref socketAddressLen, out bytesReceived, out flags, TransferCompletionCallback);
errorCode = handle.AsyncContext.ReceiveFromAsync(_buffer.Slice(_offset, _count), _socketFlags, _socketAddress.Buffer, ref socketAddressLen, out bytesReceived, out flags, TransferCompletionCallback, cancellationToken);
}
else
{
Expand Down Expand Up @@ -197,7 +197,7 @@ private void CompleteReceiveMessageFromOperation(int bytesTransferred, byte[] so
_receiveMessageFromPacketInfo = ipPacketInformation;
}

internal unsafe SocketError DoOperationReceiveMessageFrom(Socket socket, SafeSocketHandle handle)
internal unsafe SocketError DoOperationReceiveMessageFrom(Socket socket, SafeSocketHandle handle, CancellationToken cancellationToken)
{
_receiveMessageFromPacketInfo = default(IPPacketInformation);
_receivedFlags = System.Net.Sockets.SocketFlags.None;
Expand All @@ -210,7 +210,7 @@ internal unsafe SocketError DoOperationReceiveMessageFrom(Socket socket, SafeSoc
int bytesReceived;
SocketFlags receivedFlags;
IPPacketInformation ipPacketInformation;
SocketError socketError = handle.AsyncContext.ReceiveMessageFromAsync(_buffer.Slice(_offset, _count), _bufferListInternal, _socketFlags, _socketAddress.Buffer, ref socketAddressSize, isIPv4, isIPv6, out bytesReceived, out receivedFlags, out ipPacketInformation, ReceiveMessageFromCompletionCallback);
SocketError socketError = handle.AsyncContext.ReceiveMessageFromAsync(_buffer.Slice(_offset, _count), _bufferListInternal, _socketFlags, _socketAddress.Buffer, ref socketAddressSize, isIPv4, isIPv6, out bytesReceived, out receivedFlags, out ipPacketInformation, ReceiveMessageFromCompletionCallback, cancellationToken);
if (socketError != SocketError.IOPending)
{
CompleteReceiveMessageFromOperation(bytesReceived, _socketAddress.Buffer, socketAddressSize, receivedFlags, ipPacketInformation, socketError);
Expand Down Expand Up @@ -303,7 +303,7 @@ internal SocketError DoOperationSendPackets(Socket socket, SafeSocketHandle hand
return SocketError.IOPending;
}

internal SocketError DoOperationSendTo(SafeSocketHandle handle)
internal SocketError DoOperationSendTo(SafeSocketHandle handle, CancellationToken cancellationToken)
{
_receivedFlags = System.Net.Sockets.SocketFlags.None;
_socketAddressSize = 0;
Expand All @@ -313,7 +313,7 @@ internal SocketError DoOperationSendTo(SafeSocketHandle handle)
SocketError errorCode;
if (_bufferList == null)
{
errorCode = handle.AsyncContext.SendToAsync(_buffer, _offset, _count, _socketFlags, _socketAddress.Buffer, ref socketAddressLen, out bytesSent, TransferCompletionCallback);
errorCode = handle.AsyncContext.SendToAsync(_buffer, _offset, _count, _socketFlags, _socketAddress.Buffer, ref socketAddressLen, out bytesSent, TransferCompletionCallback, cancellationToken);
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ internal unsafe SocketError DoOperationReceiveMultiBuffer(SafeSocketHandle handl
}
}

internal unsafe SocketError DoOperationReceiveFrom(SafeSocketHandle handle)
internal unsafe SocketError DoOperationReceiveFrom(SafeSocketHandle handle, CancellationToken cancellationToken)
{
// WSARecvFrom uses a WSABuffer array describing buffers in which to
// receive data and from which to send data respectively. Single and multiple buffers
Expand All @@ -454,11 +454,11 @@ internal unsafe SocketError DoOperationReceiveFrom(SafeSocketHandle handle)
PinSocketAddressBuffer();

return _bufferList == null ?
DoOperationReceiveFromSingleBuffer(handle) :
DoOperationReceiveFromSingleBuffer(handle, cancellationToken) :
DoOperationReceiveFromMultiBuffer(handle);
}

internal unsafe SocketError DoOperationReceiveFromSingleBuffer(SafeSocketHandle handle)
internal unsafe SocketError DoOperationReceiveFromSingleBuffer(SafeSocketHandle handle, CancellationToken cancellationToken)
{
fixed (byte* bufferPtr = &MemoryMarshal.GetReference(_buffer.Span))
{
Expand All @@ -481,7 +481,7 @@ internal unsafe SocketError DoOperationReceiveFromSingleBuffer(SafeSocketHandle
overlapped,
IntPtr.Zero);

return ProcessIOCPResultWithSingleBufferHandle(socketError, bytesTransferred, overlapped);
return ProcessIOCPResultWithSingleBufferHandle(socketError, bytesTransferred, overlapped, cancellationToken);
}
catch
{
Expand Down Expand Up @@ -518,7 +518,7 @@ internal unsafe SocketError DoOperationReceiveFromMultiBuffer(SafeSocketHandle h
}
}

internal unsafe SocketError DoOperationReceiveMessageFrom(Socket socket, SafeSocketHandle handle)
internal unsafe SocketError DoOperationReceiveMessageFrom(Socket socket, SafeSocketHandle handle, CancellationToken cancellationToken)
{
// WSARecvMsg uses a WSAMsg descriptor.
// The WSAMsg buffer is a pinned array to avoid complicating the use of Overlapped.
Expand Down Expand Up @@ -558,25 +558,33 @@ internal unsafe SocketError DoOperationReceiveMessageFrom(Socket socket, SafeSoc
_wsaRecvMsgWSABufferArrayPinned = GC.AllocateUninitializedArray<WSABuffer>(1, pinned: true);
}

Debug.Assert(_singleBufferHandleState == SingleBufferHandleState.None);
_singleBufferHandle = _buffer.Pin();
_singleBufferHandleState = SingleBufferHandleState.Set;
fixed (byte* bufferPtr = &MemoryMarshal.GetReference(_buffer.Span))
{
Debug.Assert(_singleBufferHandleState == SingleBufferHandleState.None);
_singleBufferHandleState = SingleBufferHandleState.InProcess;

_wsaRecvMsgWSABufferArrayPinned[0].Pointer = (IntPtr)bufferPtr;
_wsaRecvMsgWSABufferArrayPinned[0].Length = _count;
wsaRecvMsgWSABufferArray = _wsaRecvMsgWSABufferArrayPinned;
wsaRecvMsgWSABufferCount = 1;

_wsaRecvMsgWSABufferArrayPinned[0].Pointer = (IntPtr)_singleBufferHandle.Pointer;
_wsaRecvMsgWSABufferArrayPinned[0].Length = _count;
wsaRecvMsgWSABufferArray = _wsaRecvMsgWSABufferArrayPinned;
wsaRecvMsgWSABufferCount = 1;
return Core();
}
}
else
{
// Use the multi-buffer WSABuffer.
wsaRecvMsgWSABufferArray = _wsaBufferArrayPinned!;
wsaRecvMsgWSABufferCount = (uint)_bufferListInternal!.Count;

return Core();
}

// Fill in WSAMessageBuffer.
unsafe
// Fill in WSAMessageBuffer, run WSARecvMsg and process the IOCP result.
// Logic is in a separate method so we can share code between the (pinned) single buffer and the multi-buffer case
SocketError Core()
{
// Fill in WSAMessageBuffer.
Interop.Winsock.WSAMsg* pMessage = (Interop.Winsock.WSAMsg*)Marshal.UnsafeAddrOfPinnedArrayElement(_wsaMessageBufferPinned, 0);
pMessage->socketAddress = PtrSocketAddressBuffer;
pMessage->addressLength = (uint)_socketAddress.Size;
Expand All @@ -596,26 +604,26 @@ internal unsafe SocketError DoOperationReceiveMessageFrom(Socket socket, SafeSoc
pMessage->controlBuffer.Length = _controlBufferPinned.Length;
}
pMessage->flags = _socketFlags;
}

NativeOverlapped* overlapped = AllocateNativeOverlapped();
try
{
SocketError socketError = socket.WSARecvMsg(
handle,
Marshal.UnsafeAddrOfPinnedArrayElement(_wsaMessageBufferPinned, 0),
out int bytesTransferred,
overlapped,
IntPtr.Zero);
NativeOverlapped* overlapped = AllocateNativeOverlapped();
try
{
SocketError socketError = socket.WSARecvMsg(
handle,
Marshal.UnsafeAddrOfPinnedArrayElement(_wsaMessageBufferPinned, 0),
out int bytesTransferred,
overlapped,
IntPtr.Zero);

return ProcessIOCPResultWithSingleBufferHandle(socketError, bytesTransferred, overlapped);
}
catch
{
_singleBufferHandleState = SingleBufferHandleState.None;
FreeNativeOverlapped(overlapped);
_singleBufferHandle.Dispose();
throw;
return ProcessIOCPResultWithSingleBufferHandle(socketError, bytesTransferred, overlapped, cancellationToken);
geoffkizer marked this conversation as resolved.
Show resolved Hide resolved
}
catch
{
_singleBufferHandleState = SingleBufferHandleState.None;
FreeNativeOverlapped(overlapped);
_singleBufferHandle.Dispose();
throw;
}
}
}

Expand Down Expand Up @@ -773,7 +781,7 @@ internal unsafe SocketError DoOperationSendPackets(Socket socket, SafeSocketHand
}
}

internal unsafe SocketError DoOperationSendTo(SafeSocketHandle handle)
internal unsafe SocketError DoOperationSendTo(SafeSocketHandle handle, CancellationToken cancellationToken)
{
// WSASendTo uses a WSABuffer array describing buffers in which to
// receive data and from which to send data respectively. Single and multiple buffers
Expand All @@ -784,11 +792,11 @@ internal unsafe SocketError DoOperationSendTo(SafeSocketHandle handle)
PinSocketAddressBuffer();

return _bufferList == null ?
DoOperationSendToSingleBuffer(handle) :
DoOperationSendToSingleBuffer(handle, cancellationToken) :
DoOperationSendToMultiBuffer(handle);
}

internal unsafe SocketError DoOperationSendToSingleBuffer(SafeSocketHandle handle)
internal unsafe SocketError DoOperationSendToSingleBuffer(SafeSocketHandle handle, CancellationToken cancellationToken)
{
fixed (byte* bufferPtr = &MemoryMarshal.GetReference(_buffer.Span))
{
Expand All @@ -810,7 +818,7 @@ internal unsafe SocketError DoOperationSendToSingleBuffer(SafeSocketHandle handl
overlapped,
IntPtr.Zero);

return ProcessIOCPResultWithSingleBufferHandle(socketError, bytesTransferred, overlapped);
return ProcessIOCPResultWithSingleBufferHandle(socketError, bytesTransferred, overlapped, cancellationToken);
}
catch
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public static ValueTask<int> SendAsync(this Socket socket, ReadOnlyMemory<byte>
[EditorBrowsable(EditorBrowsableState.Never)]
public static Task<int> SendAsync(this Socket socket, IList<ArraySegment<byte>> buffers, SocketFlags socketFlags) =>
socket.SendAsync(buffers, socketFlags);

[EditorBrowsable(EditorBrowsableState.Never)]
public static Task<int> SendToAsync(this Socket socket, ArraySegment<byte> buffer, SocketFlags socketFlags, EndPoint remoteEP) =>
socket.SendToAsync(buffer, socketFlags, remoteEP);
Expand Down
Loading