1 type derived from Socket
Microsoft.Diagnostics.NETCore.Client (1)
95 instantiations of Socket
aspire (5)
Aspire.Cli.Tests (3)
Aspire.Dashboard.Tests (1)
Aspire.Hosting (5)
Aspire.Hosting.RemoteHost (1)
Aspire.Hosting.RemoteHost.Tests (1)
Aspire.Hosting.Tests (18)
Backchannel\AuxiliaryBackchannelTests.cs (15)
45var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
84var client1Socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
85var client2Socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
86var client3Socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
125var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
160var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
203var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
245var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
325var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
366var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
403var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
452var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
494var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
537var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
580var 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 (1)
System.Net.Sockets (14)
System.ServiceModel.NetTcp (1)
System.ServiceModel.UnixDomainSocket (1)
544 references to Socket
aspire (5)
Aspire.Cli.Tests (6)
Aspire.Dashboard.Tests (1)
Aspire.Hosting (21)
Aspire.Hosting.RemoteHost (2)
Aspire.Hosting.RemoteHost.Tests (1)
Aspire.Hosting.Tests (20)
Backchannel\AuxiliaryBackchannelTests.cs (15)
45var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
84var client1Socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
85var client2Socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
86var client3Socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
125var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
160var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
203var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
245var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
325var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
366var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
403var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
452var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
494var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
537var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
580var 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 (11)
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 (321)
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
1092Socket socket = CreateAcceptSocket(acceptedSocketHandle, _rightEndPoint.Create(socketAddress));
1100if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1107if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1114if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1121if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1128if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1141if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1179if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1192if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1233if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1243if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1270if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1276/// Sends the file <paramref name="fileName"/> and buffers of data to a connected <see cref="Socket"/> object
1291/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> object has been closed.</exception>
1292/// <exception cref="NotSupportedException">The <see cref="Socket"/> object is not connected to a remote host.</exception>
1293/// <exception cref="InvalidOperationException">The <see cref="Socket"/> object is not in blocking mode and cannot accept this synchronous call.</exception>
1298if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1304/// Sends the file <paramref name="fileName"/> and buffers of data to a connected <see cref="Socket"/> object
1319/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> object has been closed.</exception>
1320/// <exception cref="NotSupportedException">The <see cref="Socket"/> object is not connected to a remote host.</exception>
1321/// <exception cref="InvalidOperationException">The <see cref="Socket"/> object is not in blocking mode and cannot accept this synchronous call.</exception>
1326if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1352if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1390if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1397if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1404if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1417/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
1420if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1434/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
1437if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1477/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
1480if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1509if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1516if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1523if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1531if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1544if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1578if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1588if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1615if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1622if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1635if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1674if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1743/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> object has been closed.</exception>
1746/// <see cref="Socket.ReceiveMessageFrom(Span{byte}, ref SocketFlags, ref EndPoint, out IPPacketInformation)"/>
1749/// <para>The <see cref="Socket"/> object is not in blocking mode and cannot accept this synchronous call.</para>
1753if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1815if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1896if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1903if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1910if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1923/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
1938/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
1941if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2021/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
2024if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2169/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
2172/// In general, the SetSocketOption method should be used whenever setting a <see cref="Socket"/> option.
2289/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
2292/// In general, the GetSocketOption method should be used whenever getting a <see cref="Socket"/> option.
2335/// <summary>Determines the status of the <see cref="Socket"/>.</summary>
2339/// The status of the <see cref="Socket"/> based on the polling mode value passed in the <paramref name="mode"/> parameter.
2349/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
2352if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2369/// <summary>Determines the status of the <see cref="Socket"/>.</summary>
2373/// The status of the <see cref="Socket"/> based on the polling mode value passed in the <paramref name="mode"/> parameter.
2384/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
2389/// <param name="checkRead">An <see cref="IList"/> of <see cref="Socket"/> instances to check for readability.</param>
2390/// <param name="checkWrite">An <see cref="IList"/> of <see cref="Socket"/> instances to check for writability.</param>
2391/// <param name="checkError">An <see cref="IList"/> of <see cref="Socket"/> instances to check for errors.</param>
2399if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2431/// <param name="checkRead">An <see cref="IList"/> of <see cref="Socket"/> instances to check for readability.</param>
2432/// <param name="checkWrite">An <see cref="IList"/> of <see cref="Socket"/> instances to check for writability.</param>
2433/// <param name="checkError">An <see cref="IList"/> of <see cref="Socket"/> instances to check for errors.</param>
2499if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2509if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2527if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2536if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2558if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2565if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2583if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2597if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2606if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2624if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2632if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2654if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2672if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2695if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2715if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2735if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2754public Socket EndAccept(IAsyncResult asyncResult) => TaskToAsyncResult.End<Socket>(asyncResult);
2759private async Task<(Socket s, byte[] buffer, int bytesReceived)> AcceptAndReceiveHelperAsync(Socket? acceptSocket, int receiveSize)
2763Socket s = await AcceptAsync(acceptSocket).ConfigureAwait(false);
2792public IAsyncResult BeginAccept(Socket? acceptSocket, int receiveSize, AsyncCallback? callback, object? state) =>
2795public Socket EndAccept(out byte[] buffer, IAsyncResult asyncResult)
2797if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2799Socket socket = EndAccept(out byte[] innerBuffer, out int bytesTransferred, asyncResult);
2805public Socket EndAccept(out byte[] buffer, out int bytesTransferred, IAsyncResult asyncResult)
2807if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2809Socket s;
2810(s, buffer, bytesTransferred) = TaskToAsyncResult.End<(Socket, byte[], int)>(asyncResult);
3019Socket? attemptSocket = dnsEP.AddressFamily != AddressFamily.Unspecified ? new Socket(dnsEP.AddressFamily, socketType, protocolType) : null;
3034Socket attemptSocket = new Socket(endPointSnapshot.AddressFamily, socketType, protocolType);
3795internal Socket CreateAcceptSocket(SafeSocketHandle fd, EndPoint? remoteEP)
3799Socket socket = new Socket(fd, loadPropertiesFromHandle: false);
3803internal Socket UpdateAcceptSocket(Socket socket, EndPoint? remoteEP)
4067Socket 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)