1 type derived from Socket
Microsoft.Diagnostics.NETCore.Client (1)
DiagnosticsIpc\IpcSocket.cs (1)
13internal class IpcSocket : Socket
66 instantiations of Socket
aspire (5)
Backchannel\AppHostAuxiliaryBackchannel.cs (1)
146socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
Backchannel\AppHostCliBackchannel.cs (1)
270var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
Backchannel\AuxiliaryBackchannelMonitor.cs (1)
349socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
Backchannel\ExtensionBackchannel.cs (1)
169var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
Projects\AppHostRpcClient.cs (1)
128var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
Aspire.Dashboard.Tests (1)
Integration\ServerRetryHelper.cs (1)
166using var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
Aspire.Hosting (3)
Backchannel\AuxiliaryBackchannelService.cs (1)
78_serverSocket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
Backchannel\BackchannelService.cs (1)
54var serverSocket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
Dcp\DcpHost.cs (1)
323var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
Aspire.Hosting.RemoteHost (1)
JsonRpcServer.cs (1)
142_listenSocket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
Aspire.Hosting.Tests (18)
Backchannel\AppHostBackchannelTests.cs (2)
41var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified); 79var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
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); 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); 322var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified); 363var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified); 400var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified); 449var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified); 487var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified); 530var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified); 573var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
Helpers\Network.cs (1)
51using var socket = new Socket(ipAddress.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
dotnet-svcutil-lib (2)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\CoreClrSocketConnection.cs (2)
927socket = new Socket(addressFamily, SocketType.Stream, ProtocolType.Tcp); 944socket = new Socket(addressFamily, SocketType.Stream, ProtocolType.Tcp);
Microsoft.Diagnostics.NETCore.Client (1)
DiagnosticsServerRouter\DiagnosticsServerRouterFactory.cs (1)
467clientSocket = new Socket(SocketType.Stream, ProtocolType.Tcp);
Microsoft.DotNet.HotReload.Watch (1)
src\sdk\src\Dotnet.Watch\AspireService\Helpers\SocketUtilities.cs (1)
63Socket socket = new Socket(addressFamily, SocketType.Stream, ProtocolType.Tcp);
Microsoft.Extensions.Hosting.Systemd (1)
SystemdNotifier.cs (1)
48using (var socket = new Socket(AddressFamily.Unix, SocketType.Dgram, ProtocolType.Unspecified))
Microsoft.Extensions.ServiceDiscovery.Dns (2)
Resolver\DnsResolver.cs (2)
724using var socket = new Socket(serverEndPoint.AddressFamily, SocketType.Dgram, ProtocolType.Udp); 774using var socket = new Socket(serverEndPoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (3)
Resolver\LoopbackDnsServer.cs (2)
22_dnsSocket = new(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); 79_tcpSocket = new(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
Resolver\ResolveAddressesTests.cs (1)
289using Socket socket = new Socket(clientAddress.AddressFamily, SocketType.Dgram, ProtocolType.Udp);
System.IO.Pipes (3)
Microsoft\Win32\SafeHandles\SafePipeHandle.Unix.cs (1)
84socket = SetPipeSocketInterlocked(new Socket(new SafeSocketHandle(handle, ownsHandle)), ownsHandle);
System\IO\Pipes\NamedPipeClientStream.Unix.cs (1)
38var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
System\IO\Pipes\NamedPipeServerStream.Unix.cs (1)
335var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
System.Net.Http (1)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (1)
682Socket socket = new Socket(SocketType.Stream, ProtocolType.Tcp) { NoDelay = true };
System.Net.HttpListener (1)
System\Net\Managed\HttpEndPointListener.cs (1)
63_socket = new Socket(addr.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
System.Net.NetworkInformation (1)
System\Net\NetworkInformation\NetworkAddressChange.Unix.cs (1)
169Socket = new Socket(sh);
System.Net.Ping (2)
src\runtime\src\libraries\Common\src\System\Net\RawSocketPermissions.cs (1)
25new Socket(addressFamily, SocketType.Raw, addressFamily == AddressFamily.InterNetwork ? ProtocolType.Icmp : ProtocolType.IcmpV6).Dispose();
System\Net\NetworkInformation\Ping.RawSocket.cs (1)
72Socket socket = new Socket(addrFamily, socketType, socketConfig.ProtocolType);
System.Net.Requests (4)
System\Net\FtpControlStream.cs (1)
1168Socket socket = new Socket(templateSocket.AddressFamily, templateSocket.SocketType, templateSocket.ProtocolType);
System\Net\FtpWebRequest.cs (2)
956var client = new Socket(SocketType.Stream, ProtocolType.Tcp); 973var client = new Socket(SocketType.Stream, ProtocolType.Tcp);
System\Net\HttpWebRequest.cs (1)
1791var socket = new Socket(SocketType.Stream, ProtocolType.Tcp);
System.Net.Sockets (14)
System\Net\Sockets\Socket.cs (3)
3018Socket? attemptSocket = dnsEP.AddressFamily != AddressFamily.Unspecified ? new Socket(dnsEP.AddressFamily, socketType, protocolType) : null; 3033Socket attemptSocket = new Socket(endPointSnapshot.AddressFamily, socketType, protocolType); 3798Socket socket = new Socket(fd, loadPropertiesFromHandle: false);
System\Net\Sockets\SocketAsyncEventArgs.cs (2)
769attemptSocket = tempSocketIPv6 ??= (Socket.OSSupportsIPv6 ? new Socket(AddressFamily.InterNetworkV6, socketType, protocolType) : null); 778attemptSocket = tempSocketIPv4 ??= (Socket.OSSupportsIPv4 ? new Socket(AddressFamily.InterNetwork, socketType, protocolType) : null);
System\Net\Sockets\TCPClient.cs (2)
374_clientSocket = new Socket(SocketType.Stream, ProtocolType.Tcp); 382_clientSocket = new Socket(_family, SocketType.Stream, ProtocolType.Tcp);
System\Net\Sockets\TCPListener.cs (4)
29_serverSocket = new Socket(_serverSocketEP.AddressFamily, SocketType.Stream, ProtocolType.Tcp); 45_serverSocket = new Socket(_serverSocketEP.AddressFamily, SocketType.Stream, ProtocolType.Tcp); 58_serverSocket = new Socket(_serverSocketEP.AddressFamily, SocketType.Stream, ProtocolType.Tcp); 273_serverSocket ??= new Socket(_serverSocketEP.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
System\Net\Sockets\UDPClient.cs (3)
668_clientSocket = new Socket(_family, SocketType.Dgram, ProtocolType.Udp); 719ipv4Socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); 723ipv6Socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Dgram, ProtocolType.Udp);
System.ServiceModel.NetTcp (1)
System\ServiceModel\Channels\SocketConnection.cs (1)
814socket = new Socket(addressFamily, SocketType.Stream, ProtocolType.Tcp);
System.ServiceModel.UnixDomainSocket (1)
System\ServiceModel\Channels\SocketConnection.cs (1)
778socket = new Socket(addressFamily, SocketType.Stream, ProtocolType.IP);
460 references to Socket
aspire (5)
Backchannel\AppHostAuxiliaryBackchannel.cs (1)
137Socket? socket = null,
Backchannel\AppHostCliBackchannel.cs (1)
270var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
Backchannel\AuxiliaryBackchannelMonitor.cs (1)
326Socket? socket = null;
Backchannel\ExtensionBackchannel.cs (1)
169var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
Projects\AppHostRpcClient.cs (1)
128var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
Aspire.Dashboard.Tests (1)
Integration\ServerRetryHelper.cs (1)
166using var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
Aspire.Hosting (14)
Backchannel\AuxiliaryBackchannelConnectedEvent.cs (2)
11internal sealed class AuxiliaryBackchannelConnectedEvent(IServiceProvider serviceProvider, string socketPath, System.Net.Sockets.Socket clientSocket) : IDistributedApplicationEvent 26public System.Net.Sockets.Socket ClientSocket { get; } = clientSocket;
Backchannel\AuxiliaryBackchannelService.cs (3)
24private Socket? _serverSocket; 91var clientSocket = await _serverSocket.AcceptAsync(stoppingToken).ConfigureAwait(false); 133private async Task HandleClientConnectionAsync(Socket clientSocket, CancellationToken stoppingToken)
Backchannel\BackchannelService.cs (3)
23private Socket? _serverSocket; 54var serverSocket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified); 66var clientSocket = await serverSocket.AcceptAsync(stoppingToken).ConfigureAwait(false);
Dcp\DcpHost.cs (6)
214var loggingSocket = CreateLoggingSocket(_locations.DcpLogSocket); 308private static Socket CreateLoggingSocket(string socketPath) 323var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified); 329private async Task StartLoggingSocketAsync(Socket socket) 336var acceptedSocket = await socket.AcceptAsync(_shutdownCts.Token).ConfigureAwait(false); 349private async Task LogSocketOutputAsync(Socket socket, CancellationToken cancellationToken)
Aspire.Hosting.RemoteHost (2)
JsonRpcServer.cs (2)
26private Socket? _listenSocket; 160var clientSocket = await _listenSocket.AcceptAsync(cancellationToken).ConfigureAwait(false);
Aspire.Hosting.Tests (18)
Backchannel\AppHostBackchannelTests.cs (2)
41var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified); 79var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
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); 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); 322var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified); 363var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified); 400var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified); 449var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified); 487var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified); 530var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified); 573var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
Helpers\Network.cs (1)
51using var socket = new Socket(ipAddress.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
dotnet-svcutil-lib (4)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\CoreClrSocketConnection.cs (4)
22private Socket _socket; 40public CoreClrSocketConnection(Socket socket, ConnectionBufferPool connectionBufferPool) 923Socket socket = null; 940Socket socket = null;
Microsoft.AspNetCore.Connections.Abstractions (1)
Features\IConnectionSocketFeature.cs (1)
16Socket Socket { get; }
Microsoft.AspNetCore.Server.Kestrel.Core (1)
AnyIPListenOptions.cs (1)
15: base(new IPEndPoint(Socket.OSSupportsIPv6 ? IPAddress.IPv6Any : IPAddress.Any, port))
Microsoft.Diagnostics.NETCore.Client (11)
DiagnosticsIpc\ExposedSocketNetworkStream.cs (2)
11public ExposedSocketNetworkStream(Socket socket, bool ownsSocket) 16public new Socket Socket => base.Socket;
DiagnosticsIpc\IpcServerTransport.cs (4)
203Socket socket = await _socket.AcceptAsync(linkedSource.Token).ConfigureAwait(false); 224internal abstract bool OnAccept(Socket socket); 242internal override bool OnAccept(Socket socket) 277internal override bool OnAccept(Socket socket)
DiagnosticsIpc\IpcSocket.cs (1)
27public async Task<Socket> AcceptAsync(CancellationToken token)
DiagnosticsIpc\IpcTcpSocketEndPoint.cs (1)
127if (Socket.OSSupportsIPv6)
DiagnosticsServerRouter\DiagnosticsServerRouterFactory.cs (2)
464Socket clientSocket; 514private async Task ConnectAsyncInternal(Socket clientSocket, EndPoint remoteEP, CancellationToken token)
ReversedServer\ReversedDiagnosticsServer.cs (1)
384Socket socket = networkStream.Socket;
Microsoft.DotNet.HotReload.Watch (3)
src\sdk\src\Dotnet.Watch\AspireService\Helpers\SocketUtilities.cs (3)
57var sockets = new List<Socket>(); 63Socket socket = new Socket(addressFamily, SocketType.Stream, ProtocolType.Tcp); 85foreach (var socket in sockets)
Microsoft.Extensions.Hosting.Systemd (1)
SystemdNotifier.cs (1)
48using (var socket = new Socket(AddressFamily.Unix, SocketType.Dgram, ProtocolType.Unspecified))
Microsoft.Extensions.ServiceDiscovery.Dns (8)
Resolver\DnsResolver.cs (8)
115int len = (Socket.OSSupportsIPv4 ? 1 : 0) + (Socket.OSSupportsIPv6 ? 1 : 0); 119if (Socket.OSSupportsIPv6) // prefer IPv6 124if (Socket.OSSupportsIPv4) 157if (addressFamily == AddressFamily.InterNetwork && Socket.OSSupportsIPv4) 161else if (addressFamily == AddressFamily.InterNetworkV6 && Socket.OSSupportsIPv6) 724using var socket = new Socket(serverEndPoint.AddressFamily, SocketType.Dgram, ProtocolType.Udp); 774using var socket = new Socket(serverEndPoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (4)
Resolver\LoopbackDnsServer.cs (3)
15private readonly Socket _dnsSocket; 16private Socket? _tcpSocket; 84using Socket tcpClient = await _tcpSocket.AcceptAsync();
Resolver\ResolveAddressesTests.cs (1)
289using Socket socket = new Socket(clientAddress.AddressFamily, SocketType.Dgram, ProtocolType.Udp);
Microsoft.TestPlatform.CommunicationUtilities (1)
SocketCommunicationManager.cs (1)
77private Socket? _socket;
netstandard (1)
netstandard.cs (1)
1268[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Net.Sockets.Socket))]
System (1)
src\runtime\src\libraries\shims\System\ref\System.cs (1)
758[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Net.Sockets.Socket))]
System.IO.Pipes (16)
Microsoft\Win32\SafeHandles\SafePipeHandle.Unix.cs (9)
25private Socket? _pipeSocket; 29internal SafePipeHandle(Socket namedPipeSocket) : base(ownsHandle: true) 35internal Socket PipeSocket => _pipeSocket ?? CreatePipeSocket(); 43if (disposing && Volatile.Read(ref _pipeSocket) is Socket socket) 74private Socket CreatePipeSocket(bool ownsHandle = true) 76Socket? socket = null; 108private Socket SetPipeSocketInterlocked(Socket socket, bool ownsHandle) 113Socket? current = Interlocked.CompareExchange(ref _pipeSocket, socket, null);
System\IO\Pipes\NamedPipeClientStream.Unix.cs (1)
38var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
System\IO\Pipes\NamedPipeServerStream.Unix.cs (5)
64Socket accepted = _instance!.ListeningSocket.AcceptAsync().GetAwaiter().GetResult(); 82Socket acceptedSocket; 101private void HandleAcceptedSocket(Socket acceptedSocket) 241internal Socket ListeningSocket { get; } 335var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
System\IO\Pipes\PipeStream.Unix.cs (1)
489Socket s, SafePipeHandle _,
System.Net (1)
System.Net.cs (1)
39[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Net.Sockets.Socket))]
System.Net.Http (2)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (2)
682Socket socket = new Socket(SocketType.Stream, ProtocolType.Tcp) { NoDelay = true }; 691using (cancellationToken.UnsafeRegister(static s => ((Socket)s!).Dispose(), socket))
System.Net.HttpListener (5)
System\Net\Managed\HttpConnection.cs (3)
49private Socket? _socket; 74public HttpConnection(Socket sock, HttpEndPointListener epl, bool secure, X509Certificate cert) 533Socket s = _socket;
System\Net\Managed\HttpEndPointListener.cs (2)
44private readonly Socket _socket; 110Socket? accepted = args.SocketError == SocketError.Success ? args.AcceptSocket : null;
System.Net.NetworkInformation (10)
System\Net\NetworkInformation\LinuxIPGlobalProperties.cs (6)
11return StringParsingHelpers.ParseActiveTcpConnectionsFromFiles(Socket.OSSupportsIPv4 ? NetworkFiles.Tcp4ConnectionsFile : null, 12Socket.OSSupportsIPv6 ? NetworkFiles.Tcp6ConnectionsFile : null); 17return StringParsingHelpers.ParseActiveTcpListenersFromFiles(Socket.OSSupportsIPv4 ? NetworkFiles.Tcp4ConnectionsFile : null, 18Socket.OSSupportsIPv6 ? NetworkFiles.Tcp6ConnectionsFile : null); 23return StringParsingHelpers.ParseActiveUdpListenersFromFiles(Socket.OSSupportsIPv4 ? NetworkFiles.Udp4ConnectionsFile : null, 24Socket.OSSupportsIPv6 ? NetworkFiles.Udp6ConnectionsFile : null);
System\Net\NetworkInformation\NetworkAddressChange.Unix.cs (4)
18private static Socket? s_socket; 20private static Socket? Socket 185private static async Task ReadEventsAsync(Socket socket) 219static unsafe Interop.Error ReadEvents(Socket socket)
System.Net.Ping (5)
System\Net\NetworkInformation\Ping.RawSocket.cs (5)
64private static Socket GetRawSocket(SocketConfig socketConfig) 72Socket socket = new Socket(addrFamily, socketType, socketConfig.ProtocolType); 253using (Socket socket = GetRawSocket(socketConfig)) 300private static unsafe PingReply CreatePingReplyForUnreachableHost(IPAddress address, Socket socket) 325using Socket socket = GetRawSocket(socketConfig);
System.Net.Quic (1)
System\Net\Quic\Internal\MsQuicApi.cs (1)
84if (!Socket.OSSupportsIPv6)
System.Net.Requests (13)
System\Net\FtpControlStream.cs (7)
31private Socket? _dataSocket; 89Socket? socket = _dataSocket; 108Socket listenSocket = connection._dataSocket!; 741Socket listenSocket = _dataSocket!; 1165private static Socket CreateFtpDataSocket(Socket templateSocket) 1168Socket socket = new Socket(templateSocket.AddressFamily, templateSocket.SocketType, templateSocket.ProtocolType);
System\Net\FtpWebRequest.cs (2)
956var client = new Socket(SocketType.Stream, ProtocolType.Tcp); 973var client = new Socket(SocketType.Stream, ProtocolType.Tcp);
System\Net\HttpWebRequest.cs (3)
1791var socket = new Socket(SocketType.Stream, ProtocolType.Tcp); 1814static void BindHelper(ServicePoint servicePoint, ref IPAddress[] addresses, Socket socket, int port) 1861using (cancellationToken.UnsafeRegister(s => ((Socket)s!).Dispose(), socket))
System\Net\NetworkStreamWrapper.cs (1)
39internal Socket Socket
System.Net.Sockets (320)
System\Net\Sockets\NetEventSource.Sockets.cs (4)
19public static void Accepted(Socket socket, object? remoteEp, object? localEp) => 27public static void Connected(Socket socket, object? localEp, object? remoteEp) => 35public static void ConnectedAsyncDns(Socket socket) => 43public static void NotLoggedFile(string filePath, Socket socket, SocketAsyncOperation completedOperation) =>
System\Net\Sockets\NetworkStream.cs (16)
15private readonly Socket _streamSocket; 30public NetworkStream(Socket socket) 35public NetworkStream(Socket socket, bool ownsSocket) 40public NetworkStream(Socket socket, FileAccess access) 45public NetworkStream(Socket socket, FileAccess access, bool ownsSocket) 85public Socket Socket => _streamSocket; 229if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 250if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 275if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 299if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 322if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 349private int _closeTimeout = Socket.DefaultCloseTimeout; // -1 = respect linger options 435if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 470if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 501if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 533if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
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(); 833if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 877if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 902if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 933if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1000/// Places a <see cref="Socket"/> in a listening state. 1008/// Places a <see cref="Socket"/> in a listening state. 1028public Socket Accept() 1030if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1091Socket socket = CreateAcceptSocket(acceptedSocketHandle, _rightEndPoint.Create(socketAddress)); 1099if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1106if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1113if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1120if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1127if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1140if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1178if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1191if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1232if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1242if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1269if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1275/// Sends the file <paramref name="fileName"/> and buffers of data to a connected <see cref="Socket"/> object 1290/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> object has been closed.</exception> 1291/// <exception cref="NotSupportedException">The <see cref="Socket"/> object is not connected to a remote host.</exception> 1292/// <exception cref="InvalidOperationException">The <see cref="Socket"/> object is not in blocking mode and cannot accept this synchronous call.</exception> 1297if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1303/// Sends the file <paramref name="fileName"/> and buffers of data to a connected <see cref="Socket"/> object 1318/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> object has been closed.</exception> 1319/// <exception cref="NotSupportedException">The <see cref="Socket"/> object is not connected to a remote host.</exception> 1320/// <exception cref="InvalidOperationException">The <see cref="Socket"/> object is not in blocking mode and cannot accept this synchronous call.</exception> 1325if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1351if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1389if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1396if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1403if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1416/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception> 1419if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1433/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception> 1436if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1476/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception> 1479if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1508if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1515if (!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 1530if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1543if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1577if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1587if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1614if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1621if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1634if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1673if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1742/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> object has been closed.</exception> 1745/// <see cref="Socket.ReceiveMessageFrom(Span{byte}, ref SocketFlags, ref EndPoint, out IPPacketInformation)"/> 1748/// <para>The <see cref="Socket"/> object is not in blocking mode and cannot accept this synchronous call.</para> 1752if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1814if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1895if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1902if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1909if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 1922/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception> 1937/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception> 1940if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 2020/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception> 2023if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 2168/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception> 2171/// In general, the SetSocketOption method should be used whenever setting a <see cref="Socket"/> option. 2288/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception> 2291/// In general, the GetSocketOption method should be used whenever getting a <see cref="Socket"/> option. 2334/// <summary>Determines the status of the <see cref="Socket"/>.</summary> 2338/// The status of the <see cref="Socket"/> based on the polling mode value passed in the <paramref name="mode"/> parameter. 2348/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception> 2351if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 2368/// <summary>Determines the status of the <see cref="Socket"/>.</summary> 2372/// The status of the <see cref="Socket"/> based on the polling mode value passed in the <paramref name="mode"/> parameter. 2383/// <exception cref="ObjectDisposedException">The <see cref="Socket"/> has been closed.</exception> 2388/// <param name="checkRead">An <see cref="IList"/> of <see cref="Socket"/> instances to check for readability.</param> 2389/// <param name="checkWrite">An <see cref="IList"/> of <see cref="Socket"/> instances to check for writability.</param> 2390/// <param name="checkError">An <see cref="IList"/> of <see cref="Socket"/> instances to check for errors.</param> 2398if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 2430/// <param name="checkRead">An <see cref="IList"/> of <see cref="Socket"/> instances to check for readability.</param> 2431/// <param name="checkWrite">An <see cref="IList"/> of <see cref="Socket"/> instances to check for writability.</param> 2432/// <param name="checkError">An <see cref="IList"/> of <see cref="Socket"/> instances to check for errors.</param> 2498if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 2508if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 2526if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 2535if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 2557if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 2564if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 2582if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 2596if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 2605if (!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 2631if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 2653if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 2671if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 2694if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 2714if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 2734if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 2753public Socket EndAccept(IAsyncResult asyncResult) => TaskToAsyncResult.End<Socket>(asyncResult); 2758private async Task<(Socket s, byte[] buffer, int bytesReceived)> AcceptAndReceiveHelperAsync(Socket? acceptSocket, int receiveSize) 2762Socket s = await AcceptAsync(acceptSocket).ConfigureAwait(false); 2791public IAsyncResult BeginAccept(Socket? acceptSocket, int receiveSize, AsyncCallback? callback, object? state) => 2794public Socket EndAccept(out byte[] buffer, IAsyncResult asyncResult) 2796if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 2798Socket socket = EndAccept(out byte[] innerBuffer, out int bytesTransferred, asyncResult); 2804public Socket EndAccept(out byte[] buffer, out int bytesTransferred, IAsyncResult asyncResult) 2806if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 2808Socket s; 2809(s, buffer, bytesTransferred) = TaskToAsyncResult.End<(Socket, byte[], int)>(asyncResult); 3018Socket? attemptSocket = dnsEP.AddressFamily != AddressFamily.Unspecified ? new Socket(dnsEP.AddressFamily, socketType, protocolType) : null; 3033Socket attemptSocket = new Socket(endPointSnapshot.AddressFamily, socketType, protocolType); 3794internal Socket CreateAcceptSocket(SafeSocketHandle fd, EndPoint? remoteEP) 3798Socket socket = new Socket(fd, loadPropertiesFromHandle: false); 3802internal Socket UpdateAcceptSocket(Socket socket, EndPoint? remoteEP) 4066Socket 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\Socket.Unix.cs (5)
171private Socket? GetOrCreateAcceptSocket(Socket? acceptSocket, bool checkDisconnected, string propertyName, out SafeSocketHandle? handle) 251internal Socket CopyStateFromSource(Socket source) 275foreach (PropertyInfo pi in typeof(Socket).GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly))
System\Net\Sockets\SocketAsyncContext.Unix.cs (12)
1284[DynamicDependency("set_PreferInlineCompletions", typeof(Socket))] 1396if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); 1533if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); 1638if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); 1671if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); 1783if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); 1852if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); 1889if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); 1981if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); 2013if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); 2092if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); 2162if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException();
System\Net\Sockets\SocketAsyncEventArgs.cs (15)
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; 769attemptSocket = tempSocketIPv6 ??= (Socket.OSSupportsIPv6 ? new Socket(AddressFamily.InterNetworkV6, socketType, protocolType) : null); 778attemptSocket = tempSocketIPv4 ??= (Socket.OSSupportsIPv4 ? new Socket(AddressFamily.InterNetwork, socketType, protocolType) : null); 951public 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\Net\Sockets\TCPClient.cs (9)
18private Socket _clientSocket = null!; // initialized by helper called from ctor 79internal TcpClient(Socket acceptedSocket) 95public Socket Client 123if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 142if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 159if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 172if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 239if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 279Socket chkClientSocket = Volatile.Read(ref _clientSocket);
System\Net\Sockets\TCPListener.cs (12)
17private Socket? _serverSocket; 62public Socket Server 184public Socket AcceptSocket() 205Socket acceptedSocket = _serverSocket!.Accept(); 212public Socket EndAcceptSocket(IAsyncResult asyncResult) => 213EndAcceptCore<Socket>(asyncResult); 221public Task<Socket> AcceptSocketAsync() => AcceptSocketAsync(CancellationToken.None).AsTask(); 223public ValueTask<Socket> AcceptSocketAsync(CancellationToken cancellationToken) 239static async ValueTask<TcpClient> WaitAndWrap(ValueTask<Socket> task) => 252if (Socket.OSSupportsIPv6) 290if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 300throw new ObjectDisposedException(typeof(Socket).FullName);
System\Net\Sockets\UDPClient.cs (20)
18private Socket _clientSocket = null!; // initialized by helper called from ctor 117public Socket Client 234Socket chkClientSocket = _clientSocket; 292if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 309if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 366if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 382if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 644/// <exception cref="ObjectDisposedException">The underlying <see cref="Socket"/> has been closed.</exception> 693if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 710Socket? ipv6Socket = null; 711Socket? ipv4Socket = null; 717if (Socket.OSSupportsIPv4) 721if (Socket.OSSupportsIPv6) 808if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 825if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 838if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 861if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 897if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 941if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 967if (!Socket.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
System\Net\Sockets\UnixDomainSocketEndPoint.cs (1)
59if (!Socket.OSSupportsUnixDomainSockets)
System.ServiceModel.NetTcp (6)
System\ServiceModel\Channels\SocketAwaitableEventArgs.cs (2)
31public ValueTask<int> ReceiveAsync(Socket socket, Memory<byte> buffer) 48public ValueTask SendAsync(Socket socket, ReadOnlyMemory<byte> memory)
System\ServiceModel\Channels\SocketConnection.cs (4)
21private Socket _socket; 72public SocketConnection(Socket socket, int bufferSize) 810Socket socket = null; 883if (Socket.OSSupportsIPv6)
System.ServiceModel.UnixDomainSocket (5)
System\ServiceModel\Channels\SocketAwaitableEventArgs.cs (2)
31public ValueTask<int> ReceiveAsync(Socket socket, Memory<byte> buffer) 48public ValueTask SendAsync(Socket socket, ReadOnlyMemory<byte> memory)
System\ServiceModel\Channels\SocketConnection.cs (3)
19private Socket _socket; 54public SocketConnection(Socket socket, int bufferSize) 774Socket socket = null;