97 instantiations of Socket
aspire (2)
Aspire.Hosting (2)
Aspire.Hosting.Tests (2)
ClientSample (1)
dotnet-svcutil-lib (2)
IIS.Common.TestLib (1)
IIS.FunctionalTests (1)
IIS.LongTests (1)
IIS.NewHandler.FunctionalTests (1)
IIS.NewShim.FunctionalTests (1)
IISExpress.FunctionalTests (2)
InMemory.FunctionalTests (3)
Interop.FunctionalTests (1)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (10)
Microsoft.AspNetCore.Server.IntegrationTesting (3)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (3)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (1)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (5)
Microsoft.AspNetCore.StaticFiles.FunctionalTests (1)
Microsoft.Extensions.Hosting.Systemd (1)
Microsoft.Extensions.ServiceDiscovery.Dns (2)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (3)
Sockets.BindTests (10)
src\Servers\Kestrel\test\BindTests\AddressRegistrationTests.cs (7)
538using (var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
573using (var socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp))
940using (var socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp))
948using (var socket = new Socket(addressFamily, SocketType.Stream, ProtocolType.Tcp))
1195using (var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
1211using (var serverSocket = new Socket(endPoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp))
1250using (var socket = new Socket(address.AddressFamily, SocketType.Stream, ProtocolType.Tcp))
Sockets.FunctionalTests (10)
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.Sockets (14)
System.ServiceModel.NetTcp (1)
System.ServiceModel.UnixDomainSocket (1)
551 references to Socket
aspire (2)
Aspire.Hosting (8)
Aspire.Hosting.Tests (2)
ClientSample (5)
dotnet-svcutil-lib (4)
IIS.Common.TestLib (6)
IIS.FunctionalTests (1)
IIS.LongTests (1)
IIS.NewHandler.FunctionalTests (1)
IIS.NewShim.FunctionalTests (1)
IISExpress.FunctionalTests (2)
InMemory.FunctionalTests (10)
Interop.FunctionalTests (1)
Microsoft.AspNetCore.Connections.Abstractions (1)
Microsoft.AspNetCore.InternalTesting (5)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (10)
Microsoft.AspNetCore.Server.IntegrationTesting (3)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (10)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (1)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (22)
Microsoft.AspNetCore.StaticFiles.FunctionalTests (3)
Microsoft.Extensions.Hosting.Systemd (1)
Microsoft.Extensions.ServiceDiscovery.Dns (8)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (4)
netstandard (1)
Sockets.BindTests (27)
src\Servers\Kestrel\test\BindTests\AddressRegistrationTests.cs (8)
538using (var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
573using (var socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp))
940using (var socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp))
948using (var socket = new Socket(addressFamily, SocketType.Stream, ProtocolType.Tcp))
1195using (var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
1211using (var serverSocket = new Socket(endPoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp))
1229if (Socket.ConnectAsync(SocketType.Stream, ProtocolType.Tcp, socketArgs))
1250using (var socket = new Socket(address.AddressFamily, SocketType.Stream, ProtocolType.Tcp))
Sockets.FunctionalTests (24)
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.Sockets (317)
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"/>.
172if (!Socket.OSSupportsUnixDomainSockets) throw new PlatformNotSupportedException();
206if (!Socket.OSSupportsUnixDomainSockets) throw new PlatformNotSupportedException();
832if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
876if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
901if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
932if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
999/// Places a <see cref="Socket"/> in a listening state.
1007/// Places a <see cref="Socket"/> in a listening state.
1027public Socket Accept()
1029if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1090Socket socket = CreateAcceptSocket(acceptedSocketHandle, _rightEndPoint.Create(socketAddress));
1098if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1105if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1112if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1119if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1126if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1139if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1177if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1190if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1231if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1241if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1268if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1274/// Sends the file <paramref name="fileName"/> and buffers of data to a connected <see cref="Socket"/> object
1289/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> object has been closed.</exception>
1290/// <exception cref="NotSupportedException">The <see cref="Socket"/> object is not connected to a remote host.</exception>
1291/// <exception cref="InvalidOperationException">The <see cref="Socket"/> object is not in blocking mode and cannot accept this synchronous call.</exception>
1296if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1302/// Sends the file <paramref name="fileName"/> and buffers of data to a connected <see cref="Socket"/> object
1317/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> object has been closed.</exception>
1318/// <exception cref="NotSupportedException">The <see cref="Socket"/> object is not connected to a remote host.</exception>
1319/// <exception cref="InvalidOperationException">The <see cref="Socket"/> object is not in blocking mode and cannot accept this synchronous call.</exception>
1324if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1343if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1381if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1388if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1395if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1408/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
1411if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1425/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
1428if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1468/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
1471if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1500if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1507if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1514if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1522if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1535if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1569if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1579if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1606if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1613if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1626if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1665if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1734/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> object has been closed.</exception>
1737/// <see cref="Socket.ReceiveMessageFrom(Span{byte}, ref SocketFlags, ref EndPoint, out IPPacketInformation)"/>
1740/// <para>The <see cref="Socket"/> object is not in blocking mode and cannot accept this synchronous call.</para>
1744if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1806if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1887if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1894if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1901if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1914/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
1929/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
1932if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2012/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
2015if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2160/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
2163/// In general, the SetSocketOption method should be used whenever setting a <see cref="Socket"/> option.
2280/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
2283/// In general, the GetSocketOption method should be used whenever getting a <see cref="Socket"/> option.
2326/// <summary>Determines the status of the <see cref="Socket"/>.</summary>
2330/// The status of the <see cref="Socket"/> based on the polling mode value passed in the <paramref name="mode"/> parameter.
2340/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
2343if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2360/// <summary>Determines the status of the <see cref="Socket"/>.</summary>
2364/// The status of the <see cref="Socket"/> based on the polling mode value passed in the <paramref name="mode"/> parameter.
2375/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception>
2380/// <param name="checkRead">An <see cref="IList"/> of <see cref="Socket"/> instances to check for readability.</param>
2381/// <param name="checkWrite">An <see cref="IList"/> of <see cref="Socket"/> instances to check for writability.</param>
2382/// <param name="checkError">An <see cref="IList"/> of <see cref="Socket"/> instances to check for errors.</param>
2390if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2422/// <param name="checkRead">An <see cref="IList"/> of <see cref="Socket"/> instances to check for readability.</param>
2423/// <param name="checkWrite">An <see cref="IList"/> of <see cref="Socket"/> instances to check for writability.</param>
2424/// <param name="checkError">An <see cref="IList"/> of <see cref="Socket"/> instances to check for errors.</param>
2490if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2500if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2518if (!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
2549if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2556if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2574if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2588if (!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
2615if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2623if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2645if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2663if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2686if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2706if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2726if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2745public Socket EndAccept(IAsyncResult asyncResult) => TaskToAsyncResult.End<Socket>(asyncResult);
2750private async Task<(Socket s, byte[] buffer, int bytesReceived)> AcceptAndReceiveHelperAsync(Socket? acceptSocket, int receiveSize)
2754Socket s = await AcceptAsync(acceptSocket).ConfigureAwait(false);
2783public IAsyncResult BeginAccept(Socket? acceptSocket, int receiveSize, AsyncCallback? callback, object? state) =>
2786public Socket EndAccept(out byte[] buffer, IAsyncResult asyncResult)
2788if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2790Socket socket = EndAccept(out byte[] innerBuffer, out int bytesTransferred, asyncResult);
2796public Socket EndAccept(out byte[] buffer, out int bytesTransferred, IAsyncResult asyncResult)
2798if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2800Socket s;
2801(s, buffer, bytesTransferred) = TaskToAsyncResult.End<(Socket, byte[], int)>(asyncResult);
3003Socket? attemptSocket = dnsEP.AddressFamily != AddressFamily.Unspecified ? new Socket(dnsEP.AddressFamily, socketType, protocolType) : null;
3018Socket attemptSocket = new Socket(endPointSnapshot.AddressFamily, socketType, protocolType);
3779internal Socket CreateAcceptSocket(SafeSocketHandle fd, EndPoint? remoteEP)
3783Socket socket = new Socket(fd, loadPropertiesFromHandle: false);
3787internal Socket UpdateAcceptSocket(Socket socket, EndPoint? remoteEP)
4051Socket 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);
326saea.Completed += (s, e) => CompleteSendReceive((Socket)s!, (TaskSocketAsyncEventArgs<int>)e, isReceive: true);
590saea.Completed += (s, e) => CompleteSendReceive((Socket)s!, (TaskSocketAsyncEventArgs<int>)e, isReceive: false);
699/// Sends the file <paramref name="fileName"/> to a connected <see cref="Socket"/> object.
703/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> object has been closed.</exception>
704/// <exception cref="NotSupportedException">The <see cref="Socket"/> object is not connected to a remote host.</exception>
713/// Sends the file <paramref name="fileName"/> and buffers of data to a connected <see cref="Socket"/> object
721/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> object has been closed.</exception>
722/// <exception cref="NotSupportedException">The <see cref="Socket"/> object is not connected to a remote host.</exception>
868private static void CompleteSendReceive(Socket s, TaskSocketAsyncEventArgs<int> saea, bool isReceive)
973internal sealed class AwaitableSocketAsyncEventArgs : SocketAsyncEventArgs, IValueTaskSource, IValueTaskSource<int>, IValueTaskSource<Socket>, IValueTaskSource<SocketReceiveFromResult>, IValueTaskSource<SocketReceiveMessageFromResult>
976private readonly Socket _owner;
985public AwaitableSocketAsyncEventArgs(Socket owner, bool isReceiveForCaching) :
1017public ValueTask<Socket> AcceptAsync(Socket socket, CancellationToken cancellationToken)
1022return new ValueTask<Socket>(this, _mrvtsc.Version);
1025Socket acceptSocket = AcceptSocket!;
1033new ValueTask<Socket>(acceptSocket) :
1034ValueTask.FromException<Socket>(CreateException(error));
1039public ValueTask<int> ReceiveAsync(Socket socket, CancellationToken cancellationToken)
1057public ValueTask<SocketReceiveFromResult> ReceiveFromAsync(Socket socket, CancellationToken cancellationToken)
1076internal ValueTask<int> ReceiveFromSocketAddressAsync(Socket socket, CancellationToken cancellationToken)
1094public ValueTask<SocketReceiveMessageFromResult> ReceiveMessageFromAsync(Socket socket, CancellationToken cancellationToken)
1117public ValueTask<int> SendAsync(Socket socket, CancellationToken cancellationToken)
1135public ValueTask SendAsyncForNetworkStream(Socket socket, CancellationToken cancellationToken)
1152public ValueTask SendPacketsAsync(Socket socket, CancellationToken cancellationToken)
1169public ValueTask<int> SendToAsync(Socket socket, CancellationToken cancellationToken)
1187public ValueTask ConnectAsync(Socket socket, CancellationToken cancellationToken)
1212public ValueTask DisconnectAsync(Socket socket, CancellationToken cancellationToken)
1281Socket IValueTaskSource<Socket>.GetResult(short token)
1289Socket acceptSocket = AcceptSocket!;
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)
VBCSCompiler.UnitTests (5)