1 type derived from Socket
Microsoft.Diagnostics.NETCore.Client (1)
100 instantiations of Socket
aspire (5)
Aspire.Cli.Tests (6)
Aspire.Dashboard.Tests (1)
Aspire.Hosting (6)
Aspire.Hosting.RemoteHost (1)
Aspire.Hosting.RemoteHost.Tests (1)
Aspire.Hosting.Tests (18)
Backchannel\AuxiliaryBackchannelTests.cs (15)
44var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
83var client1Socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
84var client2Socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
85var client3Socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
124var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
159var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
202var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
244var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
324var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
365var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
402var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
451var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
493var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
536var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
579var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
Aspire.Hosting.TestUtilities (1)
Aspire.TerminalHost (1)
Aspire.TerminalHost.Tests (4)
dotnet-svcutil-lib (2)
Microsoft.AspNetCore.Server.IntegrationTesting (3)
Microsoft.AspNetCore.Server.Kestrel.Transport.DirectTls (6)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (5)
Microsoft.Diagnostics.NETCore.Client (1)
Microsoft.DotNet.HotReload.Watch (1)
Microsoft.Extensions.Hosting.Systemd (1)
Microsoft.Extensions.ServiceDiscovery.Dns (2)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (3)
Microsoft.TemplateEngine.Orchestrator.RunnableProjects (2)
System.IO.Pipes (3)
System.Net.Http (1)
System.Net.HttpListener (1)
System.Net.NetworkInformation (1)
System.Net.Ping (2)
System.Net.Requests (4)
System.Net.Security (2)
System.Net.Sockets (14)
System.ServiceModel.NetTcp (1)
System.ServiceModel.UnixDomainSocket (1)
560 references to Socket
aspire (12)
Aspire.Cli.Tests (10)
Aspire.Dashboard.Tests (1)
Aspire.Hosting (26)
Aspire.Hosting.RemoteHost (2)
Aspire.Hosting.RemoteHost.Tests (1)
Aspire.Hosting.Tests (20)
Backchannel\AuxiliaryBackchannelTests.cs (15)
44var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
83var client1Socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
84var client2Socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
85var client3Socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
124var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
159var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
202var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
244var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
324var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
365var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
402var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
451var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
493var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
536var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
579var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
Aspire.Hosting.TestUtilities (1)
Aspire.TerminalHost (4)
Aspire.TerminalHost.Tests (10)
dotnet-svcutil-lib (4)
Microsoft.AspNetCore.Connections.Abstractions (1)
Microsoft.AspNetCore.InternalTesting (5)
Microsoft.AspNetCore.Server.IntegrationTesting (3)
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Microsoft.AspNetCore.Server.Kestrel.Transport.DirectTls (22)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (22)
Microsoft.Diagnostics.NETCore.Client (12)
Microsoft.DotNet.HotReload.Watch (3)
Microsoft.Extensions.Hosting.Systemd (1)
Microsoft.Extensions.ServiceDiscovery.Dns (4)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (4)
Microsoft.TemplateEngine.Orchestrator.RunnableProjects (3)
Microsoft.TestPlatform.CommunicationUtilities (1)
netstandard (1)
System (1)
System.IO.Pipes (16)
System.Net (1)
System.Net.Http (2)
System.Net.HttpListener (5)
System.Net.NetworkInformation (10)
System.Net.Ping (5)
System.Net.Quic (1)
System.Net.Requests (13)
System.Net.Security (1)
System.Net.Sockets (320)
System\Net\Sockets\Socket.cs (128)
69private int _closeTimeout = Socket.DefaultCloseTimeout;
103/// <summary>Initializes a new instance of the <see cref="Socket"/> class for the specified socket handle.</summary>
104/// <param name="handle">The socket handle for the socket that the <see cref="Socket"/> object will encapsulate.</param>
109/// This method populates the <see cref="Socket"/> instance with data gathered from the supplied <see cref="SafeSocketHandle"/>.
111/// properties and configuration, which means some of the public APIs on the resulting <see cref="Socket"/> instance may
112/// differ based on operating system, such as <see cref="Socket.ProtocolType"/> and <see cref="Socket.Blocking"/>.
173if (!Socket.OSSupportsUnixDomainSockets) throw new PlatformNotSupportedException();
207if (!Socket.OSSupportsUnixDomainSockets) throw new PlatformNotSupportedException();
834if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
878if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
903if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
934if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1001/// Places a <see cref="Socket"/> in a listening state.
1009/// Places a <see cref="Socket"/> in a listening state.
1029public Socket Accept()
1031if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1094Socket socket = CreateAcceptSocket(acceptedSocketHandle, remoteEndPoint);
1102if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1109if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1116if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1123if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1130if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1143if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1181if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1194if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1235if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1245if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1272if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1278/// Sends the file <paramref name="fileName"/> and buffers of data to a connected <see cref="Socket"/> object
1293/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> object has been closed.</exception>
1294/// <exception cref="NotSupportedException">The <see cref="Socket"/> object is not connected to a remote host.</exception>
1295/// <exception cref="InvalidOperationException">The <see cref="Socket"/> object is not in blocking mode and cannot accept this synchronous call.</exception>
1300if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1306/// Sends the file <paramref name="fileName"/> and buffers of data to a connected <see cref="Socket"/> object
1321/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> object has been closed.</exception>
1322/// <exception cref="NotSupportedException">The <see cref="Socket"/> object is not connected to a remote host.</exception>
1323/// <exception cref="InvalidOperationException">The <see cref="Socket"/> object is not in blocking mode and cannot accept this synchronous call.</exception>
1328if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1354if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1392if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1399if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1406if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1419/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
1422if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1436/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
1439if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1479/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
1482if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1511if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1518if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1525if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1533if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1546if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1580if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1590if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1617if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1624if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1637if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1676if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1745/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> object has been closed.</exception>
1748/// <see cref="Socket.ReceiveMessageFrom(Span{byte}, ref SocketFlags, ref EndPoint, out IPPacketInformation)"/>
1751/// <para>The <see cref="Socket"/> object is not in blocking mode and cannot accept this synchronous call.</para>
1755if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1817if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1898if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1905if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1912if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1925/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
1940/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
1943if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2023/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
2026if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2171/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
2174/// In general, the SetSocketOption method should be used whenever setting a <see cref="Socket"/> option.
2291/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
2294/// In general, the GetSocketOption method should be used whenever getting a <see cref="Socket"/> option.
2337/// <summary>Determines the status of the <see cref="Socket"/>.</summary>
2341/// The status of the <see cref="Socket"/> based on the polling mode value passed in the <paramref name="mode"/> parameter.
2351/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
2354if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2371/// <summary>Determines the status of the <see cref="Socket"/>.</summary>
2375/// The status of the <see cref="Socket"/> based on the polling mode value passed in the <paramref name="mode"/> parameter.
2386/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
2391/// <param name="checkRead">An <see cref="IList"/> of <see cref="Socket"/> instances to check for readability.</param>
2392/// <param name="checkWrite">An <see cref="IList"/> of <see cref="Socket"/> instances to check for writability.</param>
2393/// <param name="checkError">An <see cref="IList"/> of <see cref="Socket"/> instances to check for errors.</param>
2401if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2433/// <param name="checkRead">An <see cref="IList"/> of <see cref="Socket"/> instances to check for readability.</param>
2434/// <param name="checkWrite">An <see cref="IList"/> of <see cref="Socket"/> instances to check for writability.</param>
2435/// <param name="checkError">An <see cref="IList"/> of <see cref="Socket"/> instances to check for errors.</param>
2501if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2511if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2529if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2538if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2560if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2567if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2585if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2599if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2608if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2626if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2634if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2656if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2674if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2697if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2717if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2737if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2756public Socket EndAccept(IAsyncResult asyncResult) => TaskToAsyncResult.End<Socket>(asyncResult);
2761private async Task<(Socket s, byte[] buffer, int bytesReceived)> AcceptAndReceiveHelperAsync(Socket? acceptSocket, int receiveSize)
2765Socket s = await AcceptAsync(acceptSocket).ConfigureAwait(false);
2794public IAsyncResult BeginAccept(Socket? acceptSocket, int receiveSize, AsyncCallback? callback, object? state) =>
2797public Socket EndAccept(out byte[] buffer, IAsyncResult asyncResult)
2799if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2801Socket socket = EndAccept(out byte[] innerBuffer, out int bytesTransferred, asyncResult);
2807public Socket EndAccept(out byte[] buffer, out int bytesTransferred, IAsyncResult asyncResult)
2809if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2811Socket s;
2812(s, buffer, bytesTransferred) = TaskToAsyncResult.End<(Socket, byte[], int)>(asyncResult);
3021Socket? attemptSocket = dnsEP.AddressFamily != AddressFamily.Unspecified ? new Socket(dnsEP.AddressFamily, socketType, protocolType) : null;
3036Socket attemptSocket = new Socket(endPointSnapshot.AddressFamily, socketType, protocolType);
3797internal Socket CreateAcceptSocket(SafeSocketHandle fd, EndPoint? remoteEP)
3801Socket socket = new Socket(fd, loadPropertiesFromHandle: false);
3805internal Socket UpdateAcceptSocket(Socket socket, EndPoint? remoteEP)
4069Socket socket = (Socket)socketList[i]!;
System\Net\Sockets\Socket.Tasks.cs (40)
32public Task<Socket> AcceptAsync() => AcceptAsync((Socket?)null, CancellationToken.None).AsTask();
39public ValueTask<Socket> AcceptAsync(CancellationToken cancellationToken) => AcceptAsync((Socket?)null, cancellationToken);
46public Task<Socket> AcceptAsync(Socket? acceptSocket) => AcceptAsync(acceptSocket, CancellationToken.None).AsTask();
54public ValueTask<Socket> AcceptAsync(Socket? acceptSocket, CancellationToken cancellationToken)
58return ValueTask.FromCanceled<Socket>(cancellationToken);
330saea.Completed += (s, e) => CompleteSendReceive((Socket)s!, (TaskSocketAsyncEventArgs<int>)e, isReceive: true);
594saea.Completed += (s, e) => CompleteSendReceive((Socket)s!, (TaskSocketAsyncEventArgs<int>)e, isReceive: false);
703/// Sends the file <paramref name="fileName"/> to a connected <see cref="Socket"/> object.
707/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> object has been closed.</exception>
708/// <exception cref="NotSupportedException">The <see cref="Socket"/> object is not connected to a remote host.</exception>
717/// Sends the file <paramref name="fileName"/> and buffers of data to a connected <see cref="Socket"/> object
725/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> object has been closed.</exception>
726/// <exception cref="NotSupportedException">The <see cref="Socket"/> object is not connected to a remote host.</exception>
872private static void CompleteSendReceive(Socket s, TaskSocketAsyncEventArgs<int> saea, bool isReceive)
977internal sealed class AwaitableSocketAsyncEventArgs : SocketAsyncEventArgs, IValueTaskSource, IValueTaskSource<int>, IValueTaskSource<Socket>, IValueTaskSource<SocketReceiveFromResult>, IValueTaskSource<SocketReceiveMessageFromResult>
980private readonly Socket _owner;
989public AwaitableSocketAsyncEventArgs(Socket owner, bool isReceiveForCaching) :
1021public ValueTask<Socket> AcceptAsync(Socket socket, CancellationToken cancellationToken)
1026return new ValueTask<Socket>(this, _mrvtsc.Version);
1029Socket acceptSocket = AcceptSocket!;
1037new ValueTask<Socket>(acceptSocket) :
1038ValueTask.FromException<Socket>(CreateException(error));
1043public ValueTask<int> ReceiveAsync(Socket socket, CancellationToken cancellationToken)
1061public ValueTask<SocketReceiveFromResult> ReceiveFromAsync(Socket socket, CancellationToken cancellationToken)
1080internal ValueTask<int> ReceiveFromSocketAddressAsync(Socket socket, CancellationToken cancellationToken)
1098public ValueTask<SocketReceiveMessageFromResult> ReceiveMessageFromAsync(Socket socket, CancellationToken cancellationToken)
1121public ValueTask<int> SendAsync(Socket socket, CancellationToken cancellationToken)
1139public ValueTask SendAsyncForNetworkStream(Socket socket, CancellationToken cancellationToken)
1156public ValueTask SendPacketsAsync(Socket socket, CancellationToken cancellationToken)
1173public ValueTask<int> SendToAsync(Socket socket, CancellationToken cancellationToken)
1191public ValueTask ConnectAsync(Socket socket, CancellationToken cancellationToken)
1216public ValueTask DisconnectAsync(Socket socket, CancellationToken cancellationToken)
1285Socket IValueTaskSource<Socket>.GetResult(short token)
1293Socket acceptSocket = AcceptSocket!;
System\Net\Sockets\SocketAsyncEventArgs.cs (16)
17private Socket? _acceptSocket;
18private Socket? _connectSocket;
76private Socket? _currentSocket;
106public Socket? AcceptSocket
112public Socket? ConnectSocket
550internal void StartOperationCommon(Socket? socket, SocketAsyncOperation operation)
581_acceptAddressBufferCount = 2 * (Socket.GetAddressSize(_currentSocket!._rightEndPoint!) + 16);
639Socket? currentSocket = _currentSocket;
703Socket.OSSupportsIPv6 && Socket.OSSupportsIPv4;
742Socket? tempSocketIPv4 = null, tempSocketIPv6 = null;
751Socket? attemptSocket = null;
760(Socket.OSSupportsIPv6DualMode || !_currentSocket.TryReplaceHandleForAddressFamily(address.AddressFamily)))
773attemptSocket = tempSocketIPv6 ??= (Socket.OSSupportsIPv6 ? new Socket(AddressFamily.InterNetworkV6, socketType, protocolType) : null);
782attemptSocket = tempSocketIPv4 ??= (Socket.OSSupportsIPv4 ? new Socket(AddressFamily.InterNetwork, socketType, protocolType) : null);
955public void SetResults(Socket? socket, SocketError socketError, int bytesTransferred, SocketFlags flags, Exception? exception)
System\Net\Sockets\SocketAsyncEventArgs.Unix.cs (7)
46internal SocketError DoOperationAccept(Socket _ /*socket*/, SafeSocketHandle handle, SafeSocketHandle? acceptHandle, CancellationToken cancellationToken)
74internal SocketError DoOperationConnectEx(Socket _ /*socket*/, SafeSocketHandle handle, CancellationToken cancellationToken)
94internal SocketError DoOperationDisconnect(Socket socket, SafeSocketHandle handle, CancellationToken _ /*cancellationToken*/)
196internal SocketError DoOperationReceiveMessageFrom(Socket socket, SafeSocketHandle handle, CancellationToken cancellationToken)
203Socket.GetIPProtocolInformation(socket.AddressFamily, _socketAddress!, out isIPv4, out isIPv6);
244internal SocketError DoOperationSendPackets(Socket socket, SafeSocketHandle _1 /*handle*/, CancellationToken cancellationToken)
351Socket acceptedSocket = _currentSocket!.CreateAcceptSocket(
System\Net\Sockets\SocketPal.Unix.cs (29)
35public static void CheckDualModePacketInfoSupport(Socket socket)
1304public 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)
1309Socket.GetIPProtocolInformation(socket.AddressFamily, socketAddress, out isIPv4, out isIPv6);
1330public static SocketError ReceiveMessageFrom(Socket socket, SafeSocketHandle handle, Span<byte> buffer, ref SocketFlags socketFlags, SocketAddress socketAddress, out SocketAddress receiveAddress, out IPPacketInformation ipPacketInformation, out int bytesTransferred)
1335Socket.GetIPProtocolInformation(socket.AddressFamily, socketAddress, out isIPv4, out isIPv6);
1583public static void SetReceivingDualModeIPv4PacketInformation(Socket socket)
1594public static void SetIPProtectionLevel(Socket socket, SocketOptionLevel optionLevel, int protectionLevel)
1857Socket.SocketListDangerousReleaseRefs(checkRead, ref refsAdded);
1858Socket.SocketListDangerousReleaseRefs(checkWrite, ref refsAdded);
1859Socket.SocketListDangerousReleaseRefs(checkError, ref refsAdded);
1878Socket.SocketListDangerousReleaseRefs(checkRead, ref refsAdded);
1879Socket.SocketListDangerousReleaseRefs(checkWrite, ref refsAdded);
1880Socket.SocketListDangerousReleaseRefs(checkError, ref refsAdded);
1897Socket? socket = socketList[i] as Socket;
1900throw new ArgumentException(SR.Format(SR.net_sockets_select, socket?.GetType().FullName ?? "null", typeof(Socket).FullName), nameof(socketList));
1965Socket.SocketListDangerousReleaseRefs(checkRead, ref refsAdded);
1966Socket.SocketListDangerousReleaseRefs(checkWrite, ref refsAdded);
1967Socket.SocketListDangerousReleaseRefs(checkError, ref refsAdded);
1986Socket.SocketListDangerousReleaseRefs(checkRead, ref refsAdded);
1987Socket.SocketListDangerousReleaseRefs(checkWrite, ref refsAdded);
1988Socket.SocketListDangerousReleaseRefs(checkError, ref refsAdded);
2004Socket? socket = socketList[i] as Socket;
2007throw new ArgumentException(SR.Format(SR.net_sockets_select, socket?.GetType().FullName ?? "null", typeof(Socket).FullName), nameof(socketList));
2041Socket socket = (Socket)socketList[i]!;
2082Socket socket, TransmitFileOptions options, SendPacketsElement[] elements, SafeFileHandle[] fileHandles, CancellationToken cancellationToken, Action<long, SocketError> callback)
2157internal static SocketError Disconnect(Socket socket, SafeSocketHandle handle, bool reuseSocket)
System\Net\Sockets\SocketTaskExtensions.cs (22)
15public static Task<Socket> AcceptAsync(this Socket socket) =>
18public static Task<Socket> AcceptAsync(this Socket socket, Socket? acceptSocket) =>
22public static Task ConnectAsync(this Socket socket, EndPoint remoteEP) =>
25public static ValueTask ConnectAsync(this Socket socket, EndPoint remoteEP, CancellationToken cancellationToken) =>
28public static Task ConnectAsync(this Socket socket, IPAddress address, int port) =>
31public static ValueTask ConnectAsync(this Socket socket, IPAddress address, int port, CancellationToken cancellationToken) =>
34public static Task ConnectAsync(this Socket socket, IPAddress[] addresses, int port) =>
37public static ValueTask ConnectAsync(this Socket socket, IPAddress[] addresses, int port, CancellationToken cancellationToken) =>
40public static Task ConnectAsync(this Socket socket, string host, int port) =>
43public static ValueTask ConnectAsync(this Socket socket, string host, int port, CancellationToken cancellationToken) =>
47public static Task<int> ReceiveAsync(this Socket socket, ArraySegment<byte> buffer, SocketFlags socketFlags) =>
50public static ValueTask<int> ReceiveAsync(this Socket socket, Memory<byte> buffer, SocketFlags socketFlags, CancellationToken cancellationToken = default) =>
53public static Task<int> ReceiveAsync(this Socket socket, IList<ArraySegment<byte>> buffers, SocketFlags socketFlags) =>
56public static Task<SocketReceiveFromResult> ReceiveFromAsync(this Socket socket, ArraySegment<byte> buffer, SocketFlags socketFlags, EndPoint remoteEndPoint) =>
59public static Task<SocketReceiveMessageFromResult> ReceiveMessageFromAsync(this Socket socket, ArraySegment<byte> buffer, SocketFlags socketFlags, EndPoint remoteEndPoint) =>
63public static Task<int> SendAsync(this Socket socket, ArraySegment<byte> buffer, SocketFlags socketFlags) =>
66public static ValueTask<int> SendAsync(this Socket socket, ReadOnlyMemory<byte> buffer, SocketFlags socketFlags, CancellationToken cancellationToken = default) =>
69public static Task<int> SendAsync(this Socket socket, IList<ArraySegment<byte>> buffers, SocketFlags socketFlags) =>
73public static Task<int> SendToAsync(this Socket socket, ArraySegment<byte> buffer, SocketFlags socketFlags, EndPoint remoteEP) =>
System.ServiceModel.NetTcp (6)
System.ServiceModel.UnixDomainSocket (5)