339 references to SocketFlags
Aspire.Dashboard.Tests (1)
Terminal\DefaultTerminalConnectionResolverTests.cs (1)
86
Assert.Equal(1, await connection.ReceiveAsync(buffer,
SocketFlags
.None, timeout.Token));
Aspire.Hosting.Native.Core.Tests (6)
NativeSocketIsolationTests.cs (1)
247
Assert.Equal(1, await client.Socket.ReceiveAsync(new byte[1],
SocketFlags
.None, timeout.Token));
SocketConnectionListenerTests.cs (5)
54
Assert.Equal(1, await active.Socket.ReceiveAsync(response,
SocketFlags
.None, timeout.Token));
75
Assert.Equal(0, await excess.Socket.ReceiveAsync(new byte[1],
SocketFlags
.None, timeout.Token));
93
Assert.True(await client.Socket.ReceiveAsync(buffer,
SocketFlags
.None, timeout.Token) == 1,
95
await client.Socket.SendAsync(buffer,
SocketFlags
.None, timeout.Token);
96
Assert.Equal(0, await client.Socket.ReceiveAsync(buffer,
SocketFlags
.None, timeout.Token));
Aspire.Managed.Tests (1)
TerminalHostSignalTests.cs (1)
154
var count = await client.ReceiveAsync(buffer,
SocketFlags
.Peek, cancellationToken);
dotnet-svcutil-lib (2)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\CoreClrSocketConnection.cs (2)
537
_socket.Send(buffer, offset, size,
SocketFlags
.None);
584
bytesRead = _socket.Receive(buffer, offset, size,
SocketFlags
.None);
Microsoft.Diagnostics.NETCore.Client (3)
DiagnosticsServerRouter\DiagnosticsServerRouterFactory.cs (2)
92
if (networkStream.Socket.Receive(new byte[1], 0, 1, System.Net.Sockets.
SocketFlags
.Peek) == 0)
102
networkStream.Socket.Send(Array.Empty<byte>(), 0, System.Net.Sockets.
SocketFlags
.None);
ReversedServer\ReversedDiagnosticsServer.cs (1)
389
socket.Send(Array.Empty<byte>(), 0,
SocketFlags
.None);
Microsoft.Extensions.ServiceDiscovery.Dns (4)
Resolver\DnsResolver.cs (4)
741
await socket.SendToAsync(memory.Slice(0, length),
SocketFlags
.None, serverEndPoint, cancellationToken).ConfigureAwait(false);
751
int packetLength = await socket.ReceiveAsync(memory,
SocketFlags
.None, cancellationToken).ConfigureAwait(false);
792
await socket.SendAsync(buffer.AsMemory(0, length + 2),
SocketFlags
.None, cancellationToken).ConfigureAwait(false);
798
int read = await socket.ReceiveAsync(buffer.AsMemory(bytesRead),
SocketFlags
.None, cancellationToken).ConfigureAwait(false);
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (3)
Resolver\LoopbackDnsServer.cs (3)
62
await _dnsSocket.SendToAsync(buffer.AsMemory(0, bytesWritten),
SocketFlags
.None, result.RemoteEndPoint);
94
int read = await tcpClient.ReceiveAsync(buffer.AsMemory(bytesRead, toRead),
SocketFlags
.None);
105
await tcpClient.SendAsync(buffer.AsMemory(0, bytesWritten + 2),
SocketFlags
.None);
netstandard (1)
netstandard.cs (1)
1273
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Net.Sockets.
SocketFlags
))]
System (1)
parent\ref\System.cs (1)
763
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Net.Sockets.
SocketFlags
))]
System.IO.Pipes (4)
System\IO\Pipes\PipeStream.Unix.cs (4)
272
return _handle!.PipeSocket.Receive(buffer,
SocketFlags
.None);
293
int bytesWritten = _handle!.PipeSocket.Send(buffer,
SocketFlags
.None);
307
return await InternalHandle!.PipeSocket.ReceiveAsync(destination,
SocketFlags
.None, cancellationToken).ConfigureAwait(false);
321
int bytesWritten = await _handle!.PipeSocket.SendAsync(source,
SocketFlags
.None, cancellationToken).ConfigureAwait(false);
System.Net.NetworkInformation (1)
System\Net\NetworkInformation\NetworkAddressChange.Unix.cs (1)
215
await socket.ReceiveAsync(Array.Empty<byte>(),
SocketFlags
.None).ConfigureAwait(false);
System.Net.Ping (5)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.MessageHeader.cs (1)
19
public
SocketFlags
Flags;
System\Net\NetworkInformation\Ping.RawSocket.cs (4)
255
socket.SendTo(socketConfig.SendBuffer,
SocketFlags
.None, socketConfig.EndPoint);
265
int bytesReceived = socket.ReceiveFrom(receiveBuffer,
SocketFlags
.None, ref socketConfig.EndPoint);
331
SocketFlags
.None,
346
SocketFlags
.None,
System.Net.Security (6)
System\Net\Security\TlsSession.cs (6)
2080
SocketFlags
.None,
2157
SocketFlags
.None,
2184
SocketFlags
.None,
2281
SocketFlags
.None,
2360
SocketFlags
.None,
2435
SocketFlags
.None,
System.Net.Sockets (301)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\LibraryImports.g.cs (8)
1407
internal static unsafe partial global::Interop.Error Receive(global::System.Runtime.InteropServices.SafeHandle socket, byte* buffer, int bufferLen, global::System.Net.Sockets.
SocketFlags
flags, int* received)
1433
static extern unsafe global::Interop.Error __PInvoke(nint __socket_native, byte* __buffer_native, int __bufferLen_native, global::System.Net.Sockets.
SocketFlags
__flags_native, int* __received_native);
1443
internal static unsafe partial global::Interop.Error ReceiveMessage(global::System.Runtime.InteropServices.SafeHandle socket, global::Interop.Sys.MessageHeader* messageHeader, global::System.Net.Sockets.
SocketFlags
flags, long* received)
1469
static extern unsafe global::Interop.Error __PInvoke(nint __socket_native, global::Interop.Sys.MessageHeader* __messageHeader_native, global::System.Net.Sockets.
SocketFlags
__flags_native, long* __received_native);
1479
internal static unsafe partial global::Interop.Error Send(global::System.Runtime.InteropServices.SafeHandle socket, byte* buffer, int bufferLen, global::System.Net.Sockets.
SocketFlags
flags, int* sent)
1505
static extern unsafe global::Interop.Error __PInvoke(nint __socket_native, byte* __buffer_native, int __bufferLen_native, global::System.Net.Sockets.
SocketFlags
__flags_native, int* __sent_native);
1542
internal static unsafe partial global::Interop.Error SendMessage(global::System.Runtime.InteropServices.SafeHandle socket, global::Interop.Sys.MessageHeader* messageHeader, global::System.Net.Sockets.
SocketFlags
flags, long* sent)
1568
static extern unsafe global::Interop.Error __PInvoke(nint __socket_native, global::Interop.Sys.MessageHeader* __messageHeader_native, global::System.Net.Sockets.
SocketFlags
__flags_native, long* __sent_native);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.MessageHeader.cs (1)
19
public
SocketFlags
Flags;
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Receive.cs (1)
13
internal static unsafe partial Error Receive(SafeHandle socket, byte* buffer, int bufferLen,
SocketFlags
flags, int* received);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReceiveMessage.cs (1)
13
internal static unsafe partial Error ReceiveMessage(SafeHandle socket, MessageHeader* messageHeader,
SocketFlags
flags, long* received);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Send.cs (1)
13
internal static unsafe partial Error Send(SafeHandle socket, byte* buffer, int bufferLen,
SocketFlags
flags, int* sent);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.SendMessage.cs (1)
13
internal static unsafe partial Error SendMessage(SafeHandle socket, MessageHeader* messageHeader,
SocketFlags
flags, long* sent);
System\Net\Sockets\NetworkStream.cs (9)
265
return _streamSocket.Receive(buffer,
SocketFlags
.None);
312
_streamSocket.Send(buffer, offset, count,
SocketFlags
.None);
338
_streamSocket.Send(buffer,
SocketFlags
.None);
450
SocketFlags
.None,
517
SocketFlags
.None,
576
SocketFlags
.None,
599
SocketFlags
.None,
637
SocketFlags
.None,
659
SocketFlags
.None,
System\Net\Sockets\Socket.cs (62)
1105
public int Send(byte[] buffer, int size,
SocketFlags
socketFlags)
1112
public int Send(byte[] buffer,
SocketFlags
socketFlags)
1123
return Send(buffer, 0, buffer != null ? buffer.Length : 0,
SocketFlags
.None);
1130
return Send(buffers,
SocketFlags
.None);
1133
public int Send(IList<ArraySegment<byte>> buffers,
SocketFlags
socketFlags)
1146
public int Send(IList<ArraySegment<byte>> buffers,
SocketFlags
socketFlags, out SocketError errorCode)
1184
public int Send(byte[] buffer, int offset, int size,
SocketFlags
socketFlags)
1197
public int Send(byte[] buffer, int offset, int size,
SocketFlags
socketFlags, out SocketError errorCode)
1236
public int Send(ReadOnlySpan<byte> buffer) => Send(buffer,
SocketFlags
.None);
1238
public int Send(ReadOnlySpan<byte> buffer,
SocketFlags
socketFlags)
1248
public int Send(ReadOnlySpan<byte> buffer,
SocketFlags
socketFlags, out SocketError errorCode)
1357
public int SendTo(byte[] buffer, int offset, int size,
SocketFlags
socketFlags, EndPoint remoteEP)
1395
public int SendTo(byte[] buffer, int size,
SocketFlags
socketFlags, EndPoint remoteEP)
1402
public int SendTo(byte[] buffer,
SocketFlags
socketFlags, EndPoint remoteEP)
1413
return SendTo(buffer, 0, buffer != null ? buffer.Length : 0,
SocketFlags
.None, remoteEP);
1429
return SendTo(buffer,
SocketFlags
.None, remoteEP);
1433
/// Sends data to a specific endpoint using the specified <see cref="
SocketFlags
"/>.
1436
/// <param name="socketFlags">A bitwise combination of the <see cref="
SocketFlags
"/> values.</param>
1442
public int SendTo(ReadOnlySpan<byte> buffer,
SocketFlags
socketFlags, EndPoint remoteEP)
1476
/// Sends data to a specific endpoint using the specified <see cref="
SocketFlags
"/>.
1479
/// <param name="socketFlags">A bitwise combination of the <see cref="
SocketFlags
"/> values.</param>
1485
public int SendTo(ReadOnlySpan<byte> buffer,
SocketFlags
socketFlags, SocketAddress socketAddress)
1514
public int Receive(byte[] buffer, int size,
SocketFlags
socketFlags)
1521
public int Receive(byte[] buffer,
SocketFlags
socketFlags)
1532
return Receive(buffer, 0, buffer != null ? buffer.Length : 0,
SocketFlags
.None);
1536
public int Receive(byte[] buffer, int offset, int size,
SocketFlags
socketFlags)
1549
public int Receive(byte[] buffer, int offset, int size,
SocketFlags
socketFlags, out SocketError errorCode)
1581
public int Receive(Span<byte> buffer) => Receive(buffer,
SocketFlags
.None);
1583
public int Receive(Span<byte> buffer,
SocketFlags
socketFlags)
1593
public int Receive(Span<byte> buffer,
SocketFlags
socketFlags, out SocketError errorCode)
1624
return Receive(buffers,
SocketFlags
.None);
1627
public int Receive(IList<ArraySegment<byte>> buffers,
SocketFlags
socketFlags)
1640
public int Receive(IList<ArraySegment<byte>> buffers,
SocketFlags
socketFlags, out SocketError errorCode)
1679
public int ReceiveMessageFrom(byte[] buffer, int offset, int size, ref
SocketFlags
socketFlags, ref EndPoint remoteEP, out IPPacketInformation ipPacketInformation)
1739
/// A bitwise combination of the <see cref="
SocketFlags
"/> values.
1753
/// <see cref="Socket.ReceiveMessageFrom(Span{byte}, ref
SocketFlags
, ref EndPoint, out IPPacketInformation)"/>
1758
public int ReceiveMessageFrom(Span<byte> buffer, ref
SocketFlags
socketFlags, ref EndPoint remoteEP, out IPPacketInformation ipPacketInformation)
1820
public int ReceiveFrom(byte[] buffer, int offset, int size,
SocketFlags
socketFlags, ref EndPoint remoteEP)
1901
public int ReceiveFrom(byte[] buffer, int size,
SocketFlags
socketFlags, ref EndPoint remoteEP)
1908
public int ReceiveFrom(byte[] buffer,
SocketFlags
socketFlags, ref EndPoint remoteEP)
1919
return ReceiveFrom(buffer, 0, buffer != null ? buffer.Length : 0,
SocketFlags
.None, ref remoteEP);
1933
return ReceiveFrom(buffer,
SocketFlags
.None, ref remoteEP);
1937
/// Receives a datagram into the data buffer, using the specified <see cref="
SocketFlags
"/>, and stores the endpoint.
1940
/// <param name="socketFlags">A bitwise combination of the <see cref="
SocketFlags
"/> values.</param>
1946
public int ReceiveFrom(Span<byte> buffer,
SocketFlags
socketFlags, ref EndPoint remoteEP)
2020
/// Receives a datagram into the data buffer, using the specified <see cref="
SocketFlags
"/>, and stores the endpoint.
2023
/// <param name="socketFlags">A bitwise combination of the <see cref="
SocketFlags
"/> values.</param>
2029
public int ReceiveFrom(Span<byte> buffer,
SocketFlags
socketFlags, SocketAddress receivedAddress)
2504
public IAsyncResult BeginSend(byte[] buffer, int offset, int size,
SocketFlags
socketFlags, AsyncCallback? callback, object? state)
2514
public IAsyncResult? BeginSend(byte[] buffer, int offset, int size,
SocketFlags
socketFlags, out SocketError errorCode, AsyncCallback? callback, object? state)
2532
public IAsyncResult BeginSend(IList<ArraySegment<byte>> buffers,
SocketFlags
socketFlags, AsyncCallback? callback, object? state)
2541
public IAsyncResult? BeginSend(IList<ArraySegment<byte>> buffers,
SocketFlags
socketFlags, out SocketError errorCode, AsyncCallback? callback, object? state)
2588
public IAsyncResult BeginSendTo(byte[] buffer, int offset, int size,
SocketFlags
socketFlags, EndPoint remoteEP, AsyncCallback? callback, object? state)
2602
public IAsyncResult BeginReceive(byte[] buffer, int offset, int size,
SocketFlags
socketFlags, AsyncCallback? callback, object? state)
2611
public IAsyncResult? BeginReceive(byte[] buffer, int offset, int size,
SocketFlags
socketFlags, out SocketError errorCode, AsyncCallback? callback, object? state)
2629
public IAsyncResult BeginReceive(IList<ArraySegment<byte>> buffers,
SocketFlags
socketFlags, AsyncCallback? callback, object? state)
2637
public IAsyncResult? BeginReceive(IList<ArraySegment<byte>> buffers,
SocketFlags
socketFlags, out SocketError errorCode, AsyncCallback? callback, object? state)
2677
public IAsyncResult BeginReceiveMessageFrom(byte[] buffer, int offset, int size,
SocketFlags
socketFlags, ref EndPoint remoteEP, AsyncCallback? callback, object? state)
2700
public int EndReceiveMessageFrom(IAsyncResult asyncResult, ref
SocketFlags
socketFlags, ref EndPoint endPoint, out IPPacketInformation ipPacketInformation)
2720
public IAsyncResult BeginReceiveFrom(byte[] buffer, int offset, int size,
SocketFlags
socketFlags, ref EndPoint remoteEP, AsyncCallback? callback, object? state)
2784
bytesReceived = await s.ReceiveAsync(buffer,
SocketFlags
.None).ConfigureAwait(false);
3499
errorCode = SocketPal.Receive(handle, Array.Empty<byte>(), 0, 0,
SocketFlags
.None, out unused);
System\Net\Sockets\Socket.Tasks.cs (31)
255
ReceiveAsync(buffer,
SocketFlags
.None);
263
public Task<int> ReceiveAsync(ArraySegment<byte> buffer,
SocketFlags
socketFlags) => ReceiveAsync(buffer, socketFlags, fromNetworkStream: false);
265
internal Task<int> ReceiveAsync(ArraySegment<byte> buffer,
SocketFlags
socketFlags, bool fromNetworkStream)
278
ReceiveAsync(buffer,
SocketFlags
.None, cancellationToken);
287
public ValueTask<int> ReceiveAsync(Memory<byte> buffer,
SocketFlags
socketFlags, CancellationToken cancellationToken = default) =>
290
internal ValueTask<int> ReceiveAsync(Memory<byte> buffer,
SocketFlags
socketFlags, bool fromNetworkStream, CancellationToken cancellationToken)
314
ReceiveAsync(buffers,
SocketFlags
.None);
322
public Task<int> ReceiveAsync(IList<ArraySegment<byte>> buffers,
SocketFlags
socketFlags)
345
ReceiveFromAsync(buffer,
SocketFlags
.None, remoteEndPoint);
354
public Task<SocketReceiveFromResult> ReceiveFromAsync(ArraySegment<byte> buffer,
SocketFlags
socketFlags, EndPoint remoteEndPoint)
368
ReceiveFromAsync(buffer,
SocketFlags
.None, remoteEndPoint, cancellationToken);
378
public ValueTask<SocketReceiveFromResult> ReceiveFromAsync(Memory<byte> buffer,
SocketFlags
socketFlags, EndPoint remoteEndPoint, CancellationToken cancellationToken = default)
412
public ValueTask<int> ReceiveFromAsync(Memory<byte> buffer,
SocketFlags
socketFlags, SocketAddress receivedAddress, CancellationToken cancellationToken = default)
447
ReceiveMessageFromAsync(buffer,
SocketFlags
.None, remoteEndPoint);
456
public Task<SocketReceiveMessageFromResult> ReceiveMessageFromAsync(ArraySegment<byte> buffer,
SocketFlags
socketFlags, EndPoint remoteEndPoint)
470
ReceiveMessageFromAsync(buffer,
SocketFlags
.None, remoteEndPoint, cancellationToken);
480
public ValueTask<SocketReceiveMessageFromResult> ReceiveMessageFromAsync(Memory<byte> buffer,
SocketFlags
socketFlags, EndPoint remoteEndPoint, CancellationToken cancellationToken = default)
506
SendAsync(buffer,
SocketFlags
.None);
514
public Task<int> SendAsync(ArraySegment<byte> buffer,
SocketFlags
socketFlags)
527
SendAsync(buffer,
SocketFlags
.None, cancellationToken);
536
public ValueTask<int> SendAsync(ReadOnlyMemory<byte> buffer,
SocketFlags
socketFlags, CancellationToken cancellationToken = default)
554
internal ValueTask SendAsyncForNetworkStream(ReadOnlyMemory<byte> buffer,
SocketFlags
socketFlags, CancellationToken cancellationToken)
578
SendAsync(buffers,
SocketFlags
.None);
586
public Task<int> SendAsync(IList<ArraySegment<byte>> buffers,
SocketFlags
socketFlags)
609
SendToAsync(buffer,
SocketFlags
.None, remoteEP);
618
public Task<int> SendToAsync(ArraySegment<byte> buffer,
SocketFlags
socketFlags, EndPoint remoteEP)
632
SendToAsync(buffer,
SocketFlags
.None, remoteEP, cancellationToken);
642
public ValueTask<int> SendToAsync(ReadOnlyMemory<byte> buffer,
SocketFlags
socketFlags, EndPoint remoteEP, CancellationToken cancellationToken = default)
671
public ValueTask<int> SendToAsync(ReadOnlyMemory<byte> buffer,
SocketFlags
socketFlags, SocketAddress socketAddress, CancellationToken cancellationToken = default)
1108
SocketFlags
socketFlags = SocketFlags;
1339
SocketFlags
socketFlags = SocketFlags;
System\Net\Sockets\SocketAsyncContext.Unix.cs (71)
162
public
SocketFlags
Flags;
169
public Action<int, Memory<byte>,
SocketFlags
, SocketError>? Callback { get; set; }
172
Callback!(BytesTransferred, SocketAddress,
SocketFlags
.None, ErrorCode);
199
cb(bt, sa,
SocketFlags
.None, ec);
227
cb(bt, sa,
SocketFlags
.None, ec);
247
public
SocketFlags
Flags;
248
public
SocketFlags
ReceivedFlags;
253
public Action<int, Memory<byte>,
SocketFlags
, SocketError>? Callback { get; set; }
271
if (!OperatingSystem.IsWasi() && Buffer.Length == 0 && Flags ==
SocketFlags
.None && SocketAddress.Length == 0)
274
ReceivedFlags =
SocketFlags
.None;
284
ReceivedFlags =
SocketFlags
.None;
304
SocketFlags
rf = ReceivedFlags;
337
SocketFlags
rf = ReceivedFlags;
370
public
SocketFlags
Flags;
372
public
SocketFlags
ReceivedFlags;
381
public Action<int, Memory<byte>,
SocketFlags
, IPPacketInformation, SocketError>? Callback { get; set; }
401
public
SocketFlags
Flags;
403
public
SocketFlags
ReceivedFlags;
411
public Action<int, Memory<byte>,
SocketFlags
, IPPacketInformation, SocketError>? Callback { get; set; }
495
return SocketPal.TryCompleteSendTo(context._socket, Buffer.Span, ref Offset, ref Count,
SocketFlags
.None, default, ref BytesTransferred, out ErrorCode);
509
cb(bt, sa,
SocketFlags
.None, ec);
751
public SocketError ConnectAsync(Memory<byte> socketAddress, Action<int, Memory<byte>,
SocketFlags
, SocketError> callback, Memory<byte> buffer, out int sentBytes, CancellationToken cancellationToken)
780
Action<int, Memory<byte>,
SocketFlags
, SocketError> connectCallback = callback;
781
errorCode = SendToAsync(buffer.Slice(sentBytes), 0, remains,
SocketFlags
.None, Memory<byte>.Empty, ref sentBytes,
821
public SocketError Receive(Memory<byte> buffer,
SocketFlags
flags, int timeout, out int bytesReceived)
826
public SocketError Receive(Span<byte> buffer,
SocketFlags
flags, int timeout, out int bytesReceived)
831
public SocketError ReceiveAsync(Memory<byte> buffer,
SocketFlags
flags, out int bytesReceived, out
SocketFlags
receivedFlags, Action<int, Memory<byte>,
SocketFlags
, SocketError> callback, CancellationToken cancellationToken)
836
public SocketError ReceiveFrom(Memory<byte> buffer, ref
SocketFlags
flags, Memory<byte> socketAddress, out int socketAddressLen, int timeout, out int bytesReceived)
842
SocketFlags
receivedFlags;
869
public unsafe SocketError ReceiveFrom(Span<byte> buffer, ref
SocketFlags
flags, Memory<byte> socketAddress, out int socketAddressLen, int timeout, out int bytesReceived)
873
SocketFlags
receivedFlags;
903
public SocketError ReceiveAsync(Memory<byte> buffer,
SocketFlags
flags, out int bytesReceived, Action<int, Memory<byte>,
SocketFlags
, SocketError> callback, CancellationToken cancellationToken = default)
937
public SocketError ReceiveFromAsync(Memory<byte> buffer,
SocketFlags
flags, Memory<byte> socketAddress, out int socketAddressLen, out int bytesReceived, out
SocketFlags
receivedFlags, Action<int, Memory<byte>,
SocketFlags
, SocketError> callback, CancellationToken cancellationToken = default)
971
receivedFlags =
SocketFlags
.None;
975
public SocketError Receive(IList<ArraySegment<byte>> buffers,
SocketFlags
flags, int timeout, out int bytesReceived)
980
public SocketError ReceiveAsync(IList<ArraySegment<byte>> buffers,
SocketFlags
flags, out int bytesReceived, out
SocketFlags
receivedFlags, Action<int, Memory<byte>,
SocketFlags
, SocketError> callback)
985
public SocketError ReceiveFrom(IList<ArraySegment<byte>> buffers, ref
SocketFlags
flags, Memory<byte> socketAddress, out int socketAddressLen, int timeout, out int bytesReceived)
991
SocketFlags
receivedFlags;
1017
public SocketError ReceiveFromAsync(IList<ArraySegment<byte>> buffers,
SocketFlags
flags, Memory<byte> socketAddress, out int socketAddressLen, out int bytesReceived, out
SocketFlags
receivedFlags, Action<int, Memory<byte>,
SocketFlags
, SocketError> callback)
1049
receivedFlags =
SocketFlags
.None;
1056
Memory<byte> buffer, ref
SocketFlags
flags, Memory<byte> socketAddress, out int socketAddressLen, bool isIPv4, bool isIPv6, int timeout, out IPPacketInformation ipPacketInformation, out int bytesReceived)
1062
SocketFlags
receivedFlags;
1093
Span<byte> buffer, ref
SocketFlags
flags, Memory<byte> socketAddress, out int socketAddressLen, bool isIPv4, bool isIPv6, int timeout, out IPPacketInformation ipPacketInformation, out int bytesReceived)
1099
SocketFlags
receivedFlags;
1132
public SocketError ReceiveMessageFromAsync(Memory<byte> buffer, IList<ArraySegment<byte>>? buffers,
SocketFlags
flags, Memory<byte> socketAddress, out int socketAddressLen, bool isIPv4, bool isIPv6, out int bytesReceived, out
SocketFlags
receivedFlags, out IPPacketInformation ipPacketInformation, Action<int, Memory<byte>,
SocketFlags
, IPPacketInformation, SocketError> callback, CancellationToken cancellationToken = default)
1170
receivedFlags =
SocketFlags
.None;
1174
public SocketError Send(ReadOnlySpan<byte> buffer,
SocketFlags
flags, int timeout, out int bytesSent) =>
1177
public SocketError Send(byte[] buffer, int offset, int count,
SocketFlags
flags, int timeout, out int bytesSent)
1182
public SocketError SendAsync(Memory<byte> buffer, int offset, int count,
SocketFlags
flags, out int bytesSent, Action<int, Memory<byte>,
SocketFlags
, SocketError> callback, CancellationToken cancellationToken)
1188
public SocketError SendTo(byte[] buffer, int offset, int count,
SocketFlags
flags, Memory<byte> socketAddress, int timeout, out int bytesSent)
1220
public unsafe SocketError SendTo(ReadOnlySpan<byte> buffer,
SocketFlags
flags, Memory<byte> socketAddress, int timeout, out int bytesSent)
1256
public SocketError SendToAsync(Memory<byte> buffer, int offset, int count,
SocketFlags
flags, Memory<byte> socketAddress, ref int bytesSent, Action<int, Memory<byte>,
SocketFlags
, SocketError> callback, CancellationToken cancellationToken = default)
1291
public SocketError Send(IList<ArraySegment<byte>> buffers,
SocketFlags
flags, int timeout, out int bytesSent)
1296
public SocketError SendAsync(IList<ArraySegment<byte>> buffers,
SocketFlags
flags, out int bytesSent, Action<int, Memory<byte>,
SocketFlags
, SocketError> callback)
1301
public SocketError SendTo(IList<ArraySegment<byte>> buffers,
SocketFlags
flags, Memory<byte> socketAddress, int timeout, out int bytesSent)
1335
public SocketError SendToAsync(IList<ArraySegment<byte>> buffers,
SocketFlags
flags, Memory<byte> socketAddress, out int bytesSent, Action<int, Memory<byte>,
SocketFlags
, SocketError> callback)
System\Net\Sockets\SocketAsyncEventArgs.cs (13)
59
private
SocketFlags
_socketFlags;
298
public
SocketFlags
SocketFlags
431
internal void SetResults(SocketError socketError, int bytesTransferred,
SocketFlags
flags)
439
internal void SetResults(Exception exception, int bytesTransferred,
SocketFlags
flags)
631
internal void FinishOperationSyncFailure(SocketError socketError, int bytesTransferred,
SocketFlags
flags)
663
internal void FinishOperationAsyncFailure(SocketError socketError, int bytesTransferred,
SocketFlags
flags)
867
parallelState.SetResults(null, internalArgs.SocketError, 0,
SocketFlags
.None, caughtException);
892
SetResults(caughtException, 0,
SocketFlags
.None);
955
public void SetResults(Socket? socket, SocketError socketError, int bytesTransferred,
SocketFlags
flags, Exception? exception)
979
_saea.SetResults(exception!, 0,
SocketFlags
.None);
996
internal void FinishOperationSyncSuccess(int bytesTransferred,
SocketFlags
flags)
1129
internal void FinishOperationAsyncSuccess(int bytesTransferred,
SocketFlags
flags)
1146
private void FinishOperationSync(SocketError socketError, int bytesTransferred,
SocketFlags
flags)
System\Net\Sockets\SocketAsyncEventArgs.Unix.cs (30)
15
private
SocketFlags
_receivedFlags;
16
private Action<int, Memory<byte>,
SocketFlags
, SocketError>? _transferCompletionCallback;
30
CompletionCallback(0,
SocketFlags
.None, socketError);
63
FinishOperationSync(socketError, 0,
SocketFlags
.None);
69
private void ConnectCompletionCallback(int bytesTransferred, Memory<byte> socketAddress,
SocketFlags
receivedFlags, SocketError socketError)
71
CompletionCallback(bytesTransferred,
SocketFlags
.None, socketError);
79
FinishOperationSync(socketError, sentBytes,
SocketFlags
.None);
89
FinishOperationSync(socketError, 0,
SocketFlags
.None);
97
FinishOperationSync(socketError, 0,
SocketFlags
.None);
101
private Action<int, Memory<byte>,
SocketFlags
, SocketError> TransferCompletionCallback =>
104
private void TransferCompletionCallbackCore(int bytesTransferred, Memory<byte> socketAddress,
SocketFlags
receivedFlags, SocketError socketError)
111
private void CompleteTransferOperation(Memory<byte> _, int socketAddressSize,
SocketFlags
receivedFlags)
119
_receivedFlags = System.Net.Sockets.
SocketFlags
.None;
122
SocketFlags
flags;
132
flags =
SocketFlags
.None;
155
_receivedFlags = System.Net.Sockets.
SocketFlags
.None;
158
SocketFlags
flags;
180
private void ReceiveMessageFromCompletionCallback(int bytesTransferred, Memory<byte> socketAddress,
SocketFlags
receivedFlags, IPPacketInformation ipPacketInformation, SocketError errorCode)
187
private void CompleteReceiveMessageFromOperation(Memory<byte> socketAddress, int socketAddressSize,
SocketFlags
receivedFlags, IPPacketInformation ipPacketInformation)
199
_receivedFlags = System.Net.Sockets.
SocketFlags
.None;
207
SocketFlags
receivedFlags;
221
_receivedFlags = System.Net.Sockets.
SocketFlags
.None;
237
CompleteTransferOperation(null, 0,
SocketFlags
.None);
238
FinishOperationSync(errorCode, bytesSent,
SocketFlags
.None);
292
FinishOperationAsyncSuccess((int)bytesTransferred,
SocketFlags
.None);
296
FinishOperationAsyncFailure(error, (int)bytesTransferred,
SocketFlags
.None);
305
_receivedFlags = System.Net.Sockets.
SocketFlags
.None;
321
CompleteTransferOperation(_socketAddress.Buffer, _socketAddress.Size,
SocketFlags
.None);
322
FinishOperationSync(errorCode, bytesSent,
SocketFlags
.None);
385
private void CompletionCallback(int bytesTransferred,
SocketFlags
flags, SocketError socketError)
System\Net\Sockets\SocketPal.Unix.cs (47)
120
private static unsafe int SysReceive(SafeSocketHandle socket,
SocketFlags
flags, Span<byte> buffer, out Interop.Error errno)
144
private static unsafe int SysReceive(SafeSocketHandle socket,
SocketFlags
flags, Span<byte> buffer, Span<byte> socketAddress, out int socketAddressLen, out
SocketFlags
receivedFlags, out Interop.Error errno)
214
private static unsafe int SysSend(SafeSocketHandle socket,
SocketFlags
flags, ReadOnlySpan<byte> buffer, ref int offset, ref int count, out Interop.Error errno)
241
private static unsafe int SysSend(SafeSocketHandle socket,
SocketFlags
flags, ReadOnlySpan<byte> buffer, ref int offset, ref int count, ReadOnlySpan<byte> socketAddress, out Interop.Error errno)
285
private static unsafe int SysSend(SafeSocketHandle socket,
SocketFlags
flags, IList<ArraySegment<byte>> buffers, ref int bufferIndex, ref int offset, ReadOnlySpan<byte> socketAddress, out Interop.Error errno)
380
private static unsafe int SysReceive(SafeSocketHandle socket,
SocketFlags
flags, IList<ArraySegment<byte>> buffers, Span<byte> socketAddress, out int socketAddressLen, out
SocketFlags
receivedFlags, out Interop.Error errno)
483
private static unsafe int SysReceiveMessageFrom(SafeSocketHandle socket,
SocketFlags
flags, Span<byte> buffer, Span<byte> socketAddress, out int socketAddressLen, bool isIPv4, bool isIPv6, out
SocketFlags
receivedFlags, out IPPacketInformation ipPacketInformation, out Interop.Error errno)
539
SafeSocketHandle socket,
SocketFlags
flags, IList<ArraySegment<byte>> buffers,
541
out
SocketFlags
receivedFlags, out IPPacketInformation ipPacketInformation, out Interop.Error errno)
767
public static bool TryCompleteReceiveFrom(SafeSocketHandle socket, Span<byte> buffer,
SocketFlags
flags, Span<byte> socketAddress, out int socketAddressLen, out int bytesReceived, out
SocketFlags
receivedFlags, out SocketError errorCode) =>
770
public static bool TryCompleteReceiveFrom(SafeSocketHandle socket, IList<ArraySegment<byte>> buffers,
SocketFlags
flags, Span<byte> socketAddress, out int socketAddressLen, out int bytesReceived, out
SocketFlags
receivedFlags, out SocketError errorCode) =>
781
if (SysReceive(socket,
SocketFlags
.None, new Span<byte>(&buffer, 0), out Interop.Error receiveErr) < 0)
793
public static unsafe bool TryCompleteReceive(SafeSocketHandle socket, Span<byte> buffer,
SocketFlags
flags, out int bytesReceived, out SocketError errorCode)
802
Debug.Assert(flags ==
SocketFlags
.None);
807
if (OperatingSystem.IsWasi() && flags ==
SocketFlags
.None)
818
received = SysReceive(socket, flags |
SocketFlags
.Peek, new Span<byte>(&oneBytePeekBuffer, 1), out errno);
858
public static unsafe bool TryCompleteReceiveFrom(SafeSocketHandle socket, Span<byte> buffer, IList<ArraySegment<byte>>? buffers,
SocketFlags
flags, Span<byte> socketAddress, out int receivedSocketAddressLength, out int bytesReceived, out
SocketFlags
receivedFlags, out SocketError errorCode)
867
Debug.Assert(flags ==
SocketFlags
.None);
881
if (OperatingSystem.IsWasi() && flags ==
SocketFlags
.None && socketAddress.Length == 0)
885
receivedFlags =
SocketFlags
.None;
894
received = SysReceive(socket, flags |
SocketFlags
.Peek, new Span<byte>(&oneBytePeekBuffer, 1), socketAddress, out receivedSocketAddressLength, out receivedFlags, out errno);
937
public static bool TryCompleteReceiveMessageFrom(SafeSocketHandle socket, Span<byte> buffer, IList<ArraySegment<byte>>? buffers,
SocketFlags
flags, Memory<byte> socketAddress, out int receivedSocketAddressLength, bool isIPv4, bool isIPv6, out int bytesReceived, out
SocketFlags
receivedFlags, out IPPacketInformation ipPacketInformation, out SocketError errorCode)
983
public static bool TryCompleteSendTo(SafeSocketHandle socket, Span<byte> buffer, ref int offset, ref int count,
SocketFlags
flags, ReadOnlySpan<byte> socketAddress, ref int bytesSent, out SocketError errorCode)
989
public static bool TryCompleteSendTo(SafeSocketHandle socket, ReadOnlySpan<byte> buffer,
SocketFlags
flags, ReadOnlySpan<byte> socketAddress, ref int bytesSent, out SocketError errorCode)
995
public static bool TryCompleteSendTo(SafeSocketHandle socket, IList<ArraySegment<byte>> buffers, ref int bufferIndex, ref int offset,
SocketFlags
flags, ReadOnlySpan<byte> socketAddress, ref int bytesSent, out SocketError errorCode)
1001
public static bool TryCompleteSendTo(SafeSocketHandle socket, ReadOnlySpan<byte> buffer, IList<ArraySegment<byte>>? buffers, ref int bufferIndex, ref int offset, ref int count,
SocketFlags
flags, ReadOnlySpan<byte> socketAddress, ref int bytesSent, out SocketError errorCode)
1014
Debug.Assert(flags ==
SocketFlags
.None);
1212
public static SocketError Send(SafeSocketHandle handle, IList<ArraySegment<byte>> buffers,
SocketFlags
socketFlags, out int bytesTransferred)
1228
public static SocketError Send(SafeSocketHandle handle, byte[] buffer, int offset, int count,
SocketFlags
socketFlags, out int bytesTransferred)
1241
public static SocketError Send(SafeSocketHandle handle, ReadOnlySpan<byte> buffer,
SocketFlags
socketFlags, out int bytesTransferred)
1270
public static SocketError SendTo(SafeSocketHandle handle, byte[] buffer, int offset, int count,
SocketFlags
socketFlags, Memory<byte> socketAddress, out int bytesTransferred)
1283
public static SocketError SendTo(SafeSocketHandle handle, ReadOnlySpan<byte> buffer,
SocketFlags
socketFlags, Memory<byte> socketAddress, out int bytesTransferred)
1296
public static SocketError Receive(SafeSocketHandle handle, IList<ArraySegment<byte>> buffers,
SocketFlags
socketFlags, out int bytesTransferred)
1314
public static SocketError Receive(SafeSocketHandle handle, byte[] buffer, int offset, int count,
SocketFlags
socketFlags, out int bytesTransferred)
1326
public static SocketError Receive(SafeSocketHandle handle, Span<byte> buffer,
SocketFlags
socketFlags, out int bytesTransferred)
1338
public static SocketError ReceiveMessageFrom(Socket socket, SafeSocketHandle handle, byte[] buffer, int offset, int count, ref
SocketFlags
socketFlags, SocketAddress socketAddress, out SocketAddress receiveAddress, out IPPacketInformation ipPacketInformation, out int bytesTransferred)
1364
public static SocketError ReceiveMessageFrom(Socket socket, SafeSocketHandle handle, Span<byte> buffer, ref
SocketFlags
socketFlags, SocketAddress socketAddress, out SocketAddress receiveAddress, out IPPacketInformation ipPacketInformation, out int bytesTransferred)
1389
public static SocketError ReceiveFrom(SafeSocketHandle handle, byte[] buffer, int offset, int count,
SocketFlags
socketFlags, Memory<byte> socketAddress, out int socketAddressLen, out int bytesTransferred)
1401
public static SocketError ReceiveFrom(SafeSocketHandle handle, Span<byte> buffer,
SocketFlags
socketFlags, Memory<byte> socketAddress, out int socketAddressLen, out int bytesTransferred)
2130
bytesTransferred = await socket.SendAsync(e.MemoryBuffer.Value,
SocketFlags
.None, cancellationToken).ConfigureAwait(false) + bytesTransferred;
System\Net\Sockets\SocketReceiveMessageFromResult.cs (1)
13
public
SocketFlags
SocketFlags;
System\Net\Sockets\SocketTaskExtensions.cs (9)
47
public static Task<int> ReceiveAsync(this Socket socket, ArraySegment<byte> buffer,
SocketFlags
socketFlags) =>
50
public static ValueTask<int> ReceiveAsync(this Socket socket, Memory<byte> buffer,
SocketFlags
socketFlags, CancellationToken cancellationToken = default) =>
53
public static Task<int> ReceiveAsync(this Socket socket, IList<ArraySegment<byte>> buffers,
SocketFlags
socketFlags) =>
56
public static Task<SocketReceiveFromResult> ReceiveFromAsync(this Socket socket, ArraySegment<byte> buffer,
SocketFlags
socketFlags, EndPoint remoteEndPoint) =>
59
public static Task<SocketReceiveMessageFromResult> ReceiveMessageFromAsync(this Socket socket, ArraySegment<byte> buffer,
SocketFlags
socketFlags, EndPoint remoteEndPoint) =>
63
public static Task<int> SendAsync(this Socket socket, ArraySegment<byte> buffer,
SocketFlags
socketFlags) =>
66
public static ValueTask<int> SendAsync(this Socket socket, ReadOnlyMemory<byte> buffer,
SocketFlags
socketFlags, CancellationToken cancellationToken = default) =>
69
public static Task<int> SendAsync(this Socket socket, IList<ArraySegment<byte>> buffers,
SocketFlags
socketFlags) =>
73
public static Task<int> SendToAsync(this Socket socket, ArraySegment<byte> buffer,
SocketFlags
socketFlags, EndPoint remoteEP) =>
System\Net\Sockets\UDPClient.cs (15)
298
return _clientSocket.BeginSend(datagram, 0, bytes,
SocketFlags
.None, requestCallback, state);
303
return _clientSocket.BeginSendTo(datagram, 0, bytes,
SocketFlags
.None, endPoint, requestCallback, state);
377
return _clientSocket.BeginReceiveFrom(_buffer, 0, MaxUDPSize,
SocketFlags
.None, ref tempRemoteEP, requestCallback, state);
578
return _clientSocket.SendAsync(new ArraySegment<byte>(datagram, 0, bytes),
SocketFlags
.None);
583
return _clientSocket.SendToAsync(new ArraySegment<byte>(datagram, 0, bytes),
SocketFlags
.None, endPoint);
609
return _clientSocket.SendAsync(datagram,
SocketFlags
.None, cancellationToken);
617
return _clientSocket.SendToAsync(datagram,
SocketFlags
.None, endPoint, cancellationToken);
626
SocketFlags
.None,
652
SocketFlags
.None,
874
return Client.Send(dgram, 0, bytes,
SocketFlags
.None);
879
return Client.SendTo(dgram, 0, bytes,
SocketFlags
.None, endPoint);
909
return Client.Send(datagram,
SocketFlags
.None);
914
return Client.SendTo(datagram,
SocketFlags
.None, endPoint);
952
return Client.Send(dgram, 0, bytes,
SocketFlags
.None);
977
return Client.Send(datagram,
SocketFlags
.None);