86 instantiations of Socket
Aspire.Hosting (1)
Dcp\DcpHost.cs (1)
253
var socket = new
Socket
(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
ClientSample (1)
Tcp\TcpConnection.cs (1)
29
_socket = new
Socket
(SocketType.Stream, ProtocolType.Tcp);
dotnet-svcutil-lib (2)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\CoreClrSocketConnection.cs (2)
927
socket = new
Socket
(addressFamily, SocketType.Stream, ProtocolType.Tcp);
944
socket = new
Socket
(addressFamily, SocketType.Stream, ProtocolType.Tcp);
IIS.Common.TestLib (1)
TestConnections.cs (1)
245
var socket = new
Socket
(addressFamily, SocketType.Stream, ProtocolType.Tcp);
IIS.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\AspNetCorePortTests.cs (1)
161
using (var socket = new
Socket
(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
IIS.LongTests (1)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1443
using (var socket = new
Socket
(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
IIS.NewHandler.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1443
using (var socket = new
Socket
(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
IIS.NewShim.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1443
using (var socket = new
Socket
(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
IISExpress.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\AspNetCorePortTests.cs (1)
161
using (var socket = new
Socket
(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1443
using (var socket = new
Socket
(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
InMemory.FunctionalTests (3)
src\Servers\Kestrel\shared\test\CertHelper.cs (2)
48
using (Socket listener = new
Socket
(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
53
var clientSocket = new
Socket
(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
src\Servers\Kestrel\shared\test\TestConnection.cs (1)
65
var socket = new
Socket
(addressFamily, SocketType.Stream, ProtocolType.Tcp);
Interop.FunctionalTests (1)
Http2\Http2RequestTests.cs (1)
65
using var socket = new
Socket
(SocketType.Stream, ProtocolType.Tcp);
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (10)
Listener\RequestHeaderTests.cs (1)
224
Socket socket = new
Socket
(SocketType.Stream, ProtocolType.Tcp);
Listener\RequestTests.cs (1)
184
using (var socket = new
Socket
(SocketType.Stream, ProtocolType.Tcp))
Listener\ResponseHeaderTests.cs (1)
366
var s = new
Socket
(SocketType.Stream, ProtocolType.Tcp) { NoDelay = true };
RequestHeaderTests.cs (2)
73
using var socket = new
Socket
(SocketType.Stream, ProtocolType.Tcp);
273
using (Socket socket = new
Socket
(SocketType.Stream, ProtocolType.Tcp))
RequestTests.cs (4)
385
using (var socket = new
Socket
(SocketType.Stream, ProtocolType.Tcp))
541
using var socket = new
Socket
(SocketType.Stream, ProtocolType.Tcp);
588
using var socket = new
Socket
(SocketType.Stream, ProtocolType.Tcp);
637
using (var socket = new
Socket
(SocketType.Stream, ProtocolType.Tcp))
ResponseTests.cs (1)
266
using var socket = new
Socket
(SocketType.Stream, ProtocolType.Tcp);
Microsoft.AspNetCore.Server.IntegrationTesting (3)
Common\TestPortHelper.cs (2)
24
using (var socket = new
Socket
(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
37
using (var socket = new
Socket
(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
Deployers\NginxDeployer.cs (1)
45
_portSelector = new
Socket
(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (3)
src\Servers\Kestrel\shared\test\CertHelper.cs (2)
48
using (Socket listener = new
Socket
(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
53
var clientSocket = new
Socket
(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
src\Servers\Kestrel\shared\test\TestConnection.cs (1)
65
var socket = new
Socket
(addressFamily, SocketType.Stream, ProtocolType.Tcp);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (1)
QuicConnectionListenerTests.cs (1)
289
using var socket = new
Socket
(endpoint.AddressFamily, SocketType.Dgram, ProtocolType.Udp);
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (5)
Client\SocketConnectionFactory.cs (1)
56
var socket = new
Socket
(ipEndPoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp)
SocketTransportOptions.cs (4)
135
listenSocket = new
Socket
(
140
listenSocket = new
Socket
(unix.AddressFamily, SocketType.Stream, ProtocolType.Unspecified);
143
listenSocket = new
Socket
(ip.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
153
listenSocket = new
Socket
(endpoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
Microsoft.AspNetCore.StaticFiles.FunctionalTests (1)
StaticFileMiddlewareTests.cs (1)
302
var socket = new
Socket
(SocketType.Stream, ProtocolType.Tcp);
Microsoft.Extensions.Hosting.Systemd (1)
SystemdNotifier.cs (1)
50
using (var socket = new
Socket
(AddressFamily.Unix, SocketType.Dgram, ProtocolType.Unspecified))
Sockets.BindTests (10)
SocketTransportOptionsTests.cs (1)
106
var fileHandleSocket = new
Socket
(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
src\Servers\Kestrel\shared\test\TestConnection.cs (1)
65
var socket = new
Socket
(addressFamily, SocketType.Stream, ProtocolType.Tcp);
src\Servers\Kestrel\shared\test\TransportTestHelpers\IPv6SupportedConditionAttribute.cs (1)
24
using (var socket = new
Socket
(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp))
src\Servers\Kestrel\test\BindTests\AddressRegistrationTests.cs (7)
538
using (var socket = new
Socket
(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
573
using (var socket = new
Socket
(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp))
940
using (var socket = new
Socket
(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp))
948
using (var socket = new
Socket
(addressFamily, SocketType.Stream, ProtocolType.Tcp))
1195
using (var socket = new
Socket
(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
1211
using (var serverSocket = new
Socket
(endPoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp))
1250
using (var socket = new
Socket
(address.AddressFamily, SocketType.Stream, ProtocolType.Tcp))
Sockets.FunctionalTests (10)
src\Servers\Kestrel\shared\test\TestConnection.cs (1)
65
var socket = new
Socket
(addressFamily, SocketType.Stream, ProtocolType.Tcp);
src\Servers\Kestrel\shared\test\TransportTestHelpers\IPv6SupportedConditionAttribute.cs (1)
24
using (var socket = new
Socket
(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp))
src\Servers\Kestrel\test\FunctionalTests\ListenHandleTests.cs (1)
29
new
Socket
(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
src\Servers\Kestrel\test\FunctionalTests\MaxRequestBufferSizeTests.cs (1)
378
var socket = new
Socket
(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (4)
116
using (var socket = new
Socket
(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
568
using (var socket = new
Socket
(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
615
using (var socket = new
Socket
(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
709
using (var socket = new
Socket
(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
src\Servers\Kestrel\test\FunctionalTests\UnixDomainSocketsTests.cs (2)
97
using (var socket = new
Socket
(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified))
165
using (var socket = new
Socket
(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified))
System.IO.Pipes (3)
Microsoft\Win32\SafeHandles\SafePipeHandle.Unix.cs (1)
84
socket = SetPipeSocketInterlocked(new
Socket
(new SafeSocketHandle(handle, ownsHandle)), ownsHandle);
System\IO\Pipes\NamedPipeClientStream.Unix.cs (1)
38
var socket = new
Socket
(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
System\IO\Pipes\NamedPipeServerStream.Unix.cs (1)
326
var socket = new
Socket
(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
System.Net.Http (1)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (1)
687
Socket 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)
167
Socket = new
Socket
(sh);
System.Net.Ping (2)
src\libraries\Common\src\System\Net\RawSocketPermissions.cs (1)
25
new
Socket
(addressFamily, SocketType.Raw, addressFamily == AddressFamily.InterNetwork ? ProtocolType.Icmp : ProtocolType.IcmpV6).Dispose();
System\Net\NetworkInformation\Ping.RawSocket.cs (1)
69
Socket socket = new
Socket
(addrFamily, socketType, socketConfig.ProtocolType);
System.Net.Requests (4)
System\Net\FtpControlStream.cs (1)
1168
Socket socket = new
Socket
(templateSocket.AddressFamily, templateSocket.SocketType, templateSocket.ProtocolType);
System\Net\FtpWebRequest.cs (2)
958
var client = new
Socket
(SocketType.Stream, ProtocolType.Tcp);
975
var client = new
Socket
(SocketType.Stream, ProtocolType.Tcp);
System\Net\HttpWebRequest.cs (1)
1760
var socket = new
Socket
(SocketType.Stream, ProtocolType.Tcp);
System.Net.Sockets (14)
System\Net\Sockets\Socket.cs (3)
3004
Socket? attemptSocket = dnsEP.AddressFamily != AddressFamily.Unspecified ? new
Socket
(dnsEP.AddressFamily, socketType, protocolType) : null;
3019
Socket attemptSocket = new
Socket
(endPointSnapshot.AddressFamily, socketType, protocolType);
3784
Socket socket = new
Socket
(fd, loadPropertiesFromHandle: false);
System\Net\Sockets\SocketAsyncEventArgs.cs (2)
738
attemptSocket = tempSocketIPv6 ??= (Socket.OSSupportsIPv6 ? new
Socket
(AddressFamily.InterNetworkV6, socketType, protocolType) : null);
747
attemptSocket = tempSocketIPv4 ??= (Socket.OSSupportsIPv4 ? new
Socket
(AddressFamily.InterNetwork, socketType, protocolType) : null);
System\Net\Sockets\TCPClient.cs (2)
377
_clientSocket = new
Socket
(SocketType.Stream, ProtocolType.Tcp);
385
_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);
276
_serverSocket ??= new
Socket
(_serverSocketEP.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
System\Net\Sockets\UDPClient.cs (3)
663
_clientSocket = new
Socket
(_family, SocketType.Dgram, ProtocolType.Udp);
714
ipv4Socket = new
Socket
(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
718
ipv6Socket = new
Socket
(AddressFamily.InterNetworkV6, SocketType.Dgram, ProtocolType.Udp);
System.ServiceModel.UnixDomainSocket (1)
System\ServiceModel\Channels\SocketConnection.cs (1)
778
socket = new
Socket
(addressFamily, SocketType.Stream, ProtocolType.IP);
529 references to Socket
Aspire.Hosting (6)
Dcp\DcpHost.cs (6)
162
var
loggingSocket = CreateLoggingSocket(_locations.DcpLogSocket);
238
private static
Socket
CreateLoggingSocket(string socketPath)
253
var
socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
259
private async Task StartLoggingSocketAsync(
Socket
socket)
266
var
acceptedSocket = await socket.AcceptAsync(_shutdownCts.Token).ConfigureAwait(false);
279
private async Task LogSocketOutputAsync(
Socket
socket, CancellationToken cancellationToken)
ClientSample (5)
Tcp\SocketReceiver.cs (2)
14
private readonly
Socket
_socket;
18
public SocketReceiver(
Socket
socket, PipeScheduler scheduler)
Tcp\SocketSender.cs (2)
17
private readonly
Socket
_socket;
23
public SocketSender(
Socket
socket, PipeScheduler scheduler)
Tcp\TcpConnection.cs (1)
20
private readonly
Socket
_socket;
dotnet-svcutil-lib (4)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\CoreClrSocketConnection.cs (4)
22
private
Socket
_socket;
40
public CoreClrSocketConnection(
Socket
socket, ConnectionBufferPool connectionBufferPool)
923
Socket
socket = null;
940
Socket
socket = null;
IIS.Common.TestLib (6)
TestConnections.cs (6)
26
private readonly
Socket
_socket;
39
public TestConnection(
Socket
socket)
44
private TestConnection(
Socket
socket, bool ownsSocket)
51
public
Socket
Socket => _socket;
238
public static
Socket
CreateConnectedLoopbackSocket(int port, AddressFamily addressFamily)
245
var
socket = new Socket(addressFamily, SocketType.Stream, ProtocolType.Tcp);
IIS.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\AspNetCorePortTests.cs (1)
161
using (
var
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
IIS.LongTests (1)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1443
using (
var
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
IIS.NewHandler.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1443
using (
var
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
IIS.NewShim.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1443
using (
var
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
IISExpress.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\AspNetCorePortTests.cs (1)
161
using (
var
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1443
using (
var
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
InMemory.FunctionalTests (10)
src\Servers\Kestrel\shared\test\CertHelper.cs (3)
48
using (
Socket
listener = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
53
var
clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
55
Socket
serverSocket = listener.Accept();
src\Servers\Kestrel\shared\test\TestConnection.cs (7)
15
private readonly
Socket
_socket;
27
public TestConnection(
Socket
socket)
32
private TestConnection(
Socket
socket, bool ownsSocket)
38
public
Socket
Socket => _socket;
56
public static
Socket
CreateConnectedLoopbackSocket(int port) => CreateConnectedLoopbackSocket(port, AddressFamily.InterNetwork);
58
public static
Socket
CreateConnectedLoopbackSocket(int port, AddressFamily addressFamily)
65
var
socket = new Socket(addressFamily, SocketType.Stream, ProtocolType.Tcp);
Interop.FunctionalTests (1)
Http2\Http2RequestTests.cs (1)
65
using
var
socket = new Socket(SocketType.Stream, ProtocolType.Tcp);
Microsoft.AspNetCore.Connections.Abstractions (1)
Features\IConnectionSocketFeature.cs (1)
16
Socket
Socket { get; }
Microsoft.AspNetCore.InternalTesting (5)
HttpClientSlim.cs (5)
152
var
socket = await GetSocket(requestUri).ConfigureAwait(false);
171
public static async Task<
Socket
> GetSocket(Uri requestUri)
173
var tcs = new TaskCompletionSource<
Socket
>();
180
if (
Socket
.ConnectAsync(SocketType.Stream, ProtocolType.Tcp, socketArgs))
185
var
socket = socketArgs.ConnectSocket;
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (10)
Listener\RequestHeaderTests.cs (1)
224
Socket
socket = new Socket(SocketType.Stream, ProtocolType.Tcp);
Listener\RequestTests.cs (1)
184
using (
var
socket = new Socket(SocketType.Stream, ProtocolType.Tcp))
Listener\ResponseHeaderTests.cs (1)
366
var
s = new Socket(SocketType.Stream, ProtocolType.Tcp) { NoDelay = true };
RequestHeaderTests.cs (2)
73
using
var
socket = new Socket(SocketType.Stream, ProtocolType.Tcp);
273
using (
Socket
socket = new Socket(SocketType.Stream, ProtocolType.Tcp))
RequestTests.cs (4)
385
using (
var
socket = new Socket(SocketType.Stream, ProtocolType.Tcp))
541
using
var
socket = new Socket(SocketType.Stream, ProtocolType.Tcp);
588
using
var
socket = new Socket(SocketType.Stream, ProtocolType.Tcp);
637
using (
var
socket = new Socket(SocketType.Stream, ProtocolType.Tcp))
ResponseTests.cs (1)
266
using
var
socket = new Socket(SocketType.Stream, ProtocolType.Tcp);
Microsoft.AspNetCore.Server.IntegrationTesting (3)
Common\TestPortHelper.cs (2)
24
using (
var
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
37
using (
var
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
Deployers\NginxDeployer.cs (1)
21
private
Socket
_portSelector;
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (10)
src\Servers\Kestrel\shared\test\CertHelper.cs (3)
48
using (
Socket
listener = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
53
var
clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
55
Socket
serverSocket = listener.Accept();
src\Servers\Kestrel\shared\test\TestConnection.cs (7)
15
private readonly
Socket
_socket;
27
public TestConnection(
Socket
socket)
32
private TestConnection(
Socket
socket, bool ownsSocket)
38
public
Socket
Socket => _socket;
56
public static
Socket
CreateConnectedLoopbackSocket(int port) => CreateConnectedLoopbackSocket(port, AddressFamily.InterNetwork);
58
public static
Socket
CreateConnectedLoopbackSocket(int port, AddressFamily addressFamily)
65
var
socket = new Socket(addressFamily, SocketType.Stream, ProtocolType.Tcp);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (2)
QuicConnectionListenerTests.cs (2)
133
var
serverStream = await serverStreamTask.DefaultTimeout();
289
using
var
socket = new Socket(endpoint.AddressFamily, SocketType.Dgram, ProtocolType.Udp);
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (22)
Client\SocketConnectionFactory.cs (1)
56
var
socket = new Socket(ipEndPoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp)
Internal\SocketConnection.cs (2)
17
private readonly
Socket
_socket;
34
internal SocketConnection(
Socket
socket,
Internal\SocketConnection.FeatureCollection.cs (1)
11
public
Socket
Socket => _socket;
Internal\SocketReceiver.cs (2)
15
public ValueTask<SocketOperationResult> WaitForDataAsync(
Socket
socket)
32
public ValueTask<SocketOperationResult> ReceiveAsync(
Socket
socket, Memory<byte> buffer)
Internal\SocketSender.cs (2)
20
public ValueTask<SocketOperationResult> SendAsync(
Socket
socket, in ReadOnlySequence<byte> buffers)
59
private ValueTask<SocketOperationResult> SendAsync(
Socket
socket, ReadOnlyMemory<byte> memory)
SocketConnectionContextFactory.cs (1)
88
public ConnectionContext Create(
Socket
socket)
SocketConnectionListener.cs (3)
17
private
Socket
? _listenSocket;
41
Socket
listenSocket;
67
var
acceptSocket = await _listenSocket.AcceptAsync(cancellationToken);
SocketTransportOptions.cs (10)
99
/// A function used to create a new <see cref="
Socket
"/> to listen with. If
103
/// Implementors are expected to call <see cref="
Socket
.Bind"/> on the
104
/// <see cref="
Socket
"/>. Please note that <see cref="CreateDefaultBoundListenSocket"/>
105
/// calls <see cref="
Socket
.Bind"/> as part of its implementation, so implementors
111
public Func<EndPoint,
Socket
> CreateBoundListenSocket { get; set; } = CreateDefaultBoundListenSocket;
114
/// Creates a default instance of <see cref="
Socket
"/> for the given <see cref="EndPoint"/>
115
/// that can be used by a connection listener to listen for inbound requests. <see cref="
Socket
.Bind"/>
122
/// A <see cref="
Socket
"/> instance.
124
public static
Socket
CreateDefaultBoundListenSocket(EndPoint endpoint)
126
Socket
listenSocket;
Microsoft.AspNetCore.StaticFiles.FunctionalTests (3)
StaticFileMiddlewareTests.cs (3)
282
var
socket = SendSocketRequestAsync(Helpers.GetAddress(host), "/TestDocument1MB.txt");
293
private
Socket
SendSocketRequestAsync(string address, string path, string method = "GET")
302
var
socket = new Socket(SocketType.Stream, ProtocolType.Tcp);
Microsoft.Extensions.Hosting.Systemd (1)
SystemdNotifier.cs (1)
50
using (
var
socket = new Socket(AddressFamily.Unix, SocketType.Dgram, ProtocolType.Unspecified))
netstandard (1)
netstandard.cs (1)
1268
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Net.Sockets.
Socket
))]
Sockets.BindTests (27)
SocketTransportOptionsTests.cs (7)
28
Socket
CreateListenSocket(EndPoint endpoint)
57
using
var
fileHandleSocket = CreateBoundSocket();
67
using
var
listenSocket = SocketTransportOptions.CreateDefaultBoundListenSocket(endpoint);
74
using
var
fileHandleSocket = CreateBoundSocket();
77
using
var
listenSocket = SocketTransportOptions.CreateDefaultBoundListenSocket(endpoint);
101
private static
Socket
CreateBoundSocket()
106
var
fileHandleSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
src\Servers\Kestrel\shared\test\TestConnection.cs (7)
15
private readonly
Socket
_socket;
27
public TestConnection(
Socket
socket)
32
private TestConnection(
Socket
socket, bool ownsSocket)
38
public
Socket
Socket => _socket;
56
public static
Socket
CreateConnectedLoopbackSocket(int port) => CreateConnectedLoopbackSocket(port, AddressFamily.InterNetwork);
58
public static
Socket
CreateConnectedLoopbackSocket(int port, AddressFamily addressFamily)
65
var
socket = new Socket(addressFamily, SocketType.Stream, ProtocolType.Tcp);
src\Servers\Kestrel\shared\test\TransportTestHelpers\HostNameIsReachableAttribute.cs (4)
62
public static async Task<
Socket
> ConnectToHost(string hostName, int port)
64
var tcs = new TaskCompletionSource<
Socket
>(TaskCreationOptions.RunContinuationsAsynchronously);
71
if (
Socket
.ConnectAsync(SocketType.Stream, ProtocolType.Tcp, socketArgs))
76
var
socket = socketArgs.ConnectSocket;
src\Servers\Kestrel\shared\test\TransportTestHelpers\IPv6SupportedConditionAttribute.cs (1)
24
using (
var
socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp))
src\Servers\Kestrel\test\BindTests\AddressRegistrationTests.cs (8)
538
using (
var
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
573
using (
var
socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp))
940
using (
var
socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp))
948
using (
var
socket = new Socket(addressFamily, SocketType.Stream, ProtocolType.Tcp))
1195
using (
var
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
1211
using (
var
serverSocket = new Socket(endPoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp))
1229
if (
Socket
.ConnectAsync(SocketType.Stream, ProtocolType.Tcp, socketArgs))
1250
using (
var
socket = new Socket(address.AddressFamily, SocketType.Stream, ProtocolType.Tcp))
Sockets.FunctionalTests (24)
SocketTransportTests.cs (1)
37
var
socket = context.Features.Get<IConnectionSocketFeature>().Socket;
src\Servers\Kestrel\shared\test\TestConnection.cs (7)
15
private readonly
Socket
_socket;
27
public TestConnection(
Socket
socket)
32
private TestConnection(
Socket
socket, bool ownsSocket)
38
public
Socket
Socket => _socket;
56
public static
Socket
CreateConnectedLoopbackSocket(int port) => CreateConnectedLoopbackSocket(port, AddressFamily.InterNetwork);
58
public static
Socket
CreateConnectedLoopbackSocket(int port, AddressFamily addressFamily)
65
var
socket = new Socket(addressFamily, SocketType.Stream, ProtocolType.Tcp);
src\Servers\Kestrel\shared\test\TransportTestHelpers\HostNameIsReachableAttribute.cs (4)
62
public static async Task<
Socket
> ConnectToHost(string hostName, int port)
64
var tcs = new TaskCompletionSource<
Socket
>(TaskCreationOptions.RunContinuationsAsynchronously);
71
if (
Socket
.ConnectAsync(SocketType.Stream, ProtocolType.Tcp, socketArgs))
76
var
socket = socketArgs.ConnectSocket;
src\Servers\Kestrel\shared\test\TransportTestHelpers\IPv6SupportedConditionAttribute.cs (1)
24
using (
var
socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp))
src\Servers\Kestrel\test\FunctionalTests\ListenHandleTests.cs (1)
28
private static readonly
Socket
_canListenToOpenTcpSocketHandleSocket =
src\Servers\Kestrel\test\FunctionalTests\MaxRequestBufferSizeTests.cs (4)
138
using (
var
socket = CreateSocket(port))
231
using (
var
socket = CreateSocket(port))
376
private static
Socket
CreateSocket(int port)
378
var
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (4)
116
using (
var
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
568
using (
var
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
615
using (
var
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
709
using (
var
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
src\Servers\Kestrel\test\FunctionalTests\UnixDomainSocketsTests.cs (2)
97
using (
var
socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified))
165
using (
var
socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified))
System (1)
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)
25
private
Socket
? _pipeSocket;
29
internal SafePipeHandle(
Socket
namedPipeSocket) : base(ownsHandle: true)
35
internal
Socket
PipeSocket => _pipeSocket ?? CreatePipeSocket();
43
if (disposing && Volatile.Read(ref _pipeSocket) is
Socket
socket)
74
private
Socket
CreatePipeSocket(bool ownsHandle = true)
76
Socket
? socket = null;
108
private
Socket
SetPipeSocketInterlocked(
Socket
socket, bool ownsHandle)
113
Socket
? current = Interlocked.CompareExchange(ref _pipeSocket, socket, null);
System\IO\Pipes\NamedPipeClientStream.Unix.cs (1)
38
var
socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
System\IO\Pipes\NamedPipeServerStream.Unix.cs (5)
64
Socket
accepted = _instance!.ListeningSocket.AcceptAsync().GetAwaiter().GetResult();
82
Socket
acceptedSocket;
101
private void HandleAcceptedSocket(
Socket
acceptedSocket)
244
internal
Socket
ListeningSocket { get; }
326
var
socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
System\IO\Pipes\PipeStream.Unix.cs (1)
489
Socket
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)
687
Socket
socket = new Socket(SocketType.Stream, ProtocolType.Tcp) { NoDelay = true };
696
using (cancellationToken.UnsafeRegister(static s => ((
Socket
)s!).Dispose(), socket))
System.Net.HttpListener (5)
System\Net\Managed\HttpConnection.cs (3)
49
private
Socket
? _socket;
74
public HttpConnection(
Socket
sock, HttpEndPointListener epl, bool secure, X509Certificate cert)
528
Socket
s = _socket;
System\Net\Managed\HttpEndPointListener.cs (2)
44
private readonly
Socket
_socket;
110
Socket
? accepted = args.SocketError == SocketError.Success ? args.AcceptSocket : null;
System.Net.NetworkInformation (10)
System\Net\NetworkInformation\LinuxIPGlobalProperties.cs (6)
11
return StringParsingHelpers.ParseActiveTcpConnectionsFromFiles(
Socket
.OSSupportsIPv4 ? NetworkFiles.Tcp4ConnectionsFile : null,
12
Socket
.OSSupportsIPv6 ? NetworkFiles.Tcp6ConnectionsFile : null);
17
return StringParsingHelpers.ParseActiveTcpListenersFromFiles(
Socket
.OSSupportsIPv4 ? NetworkFiles.Tcp4ConnectionsFile : null,
18
Socket
.OSSupportsIPv6 ? NetworkFiles.Tcp6ConnectionsFile : null);
23
return StringParsingHelpers.ParseActiveUdpListenersFromFiles(
Socket
.OSSupportsIPv4 ? NetworkFiles.Udp4ConnectionsFile : null,
24
Socket
.OSSupportsIPv6 ? NetworkFiles.Udp6ConnectionsFile : null);
System\Net\NetworkInformation\NetworkAddressChange.Unix.cs (4)
18
private static
Socket
? s_socket;
20
private static
Socket
? Socket
183
private static async Task ReadEventsAsync(
Socket
socket)
217
static unsafe Interop.Error ReadEvents(
Socket
socket)
System.Net.Ping (5)
System\Net\NetworkInformation\Ping.RawSocket.cs (5)
61
private static
Socket
GetRawSocket(SocketConfig socketConfig)
69
Socket
socket = new Socket(addrFamily, socketType, socketConfig.ProtocolType);
253
using (
Socket
socket = GetRawSocket(socketConfig))
300
private static PingReply CreatePingReplyForUnreachableHost(IPAddress address,
Socket
socket)
325
using
Socket
socket = GetRawSocket(socketConfig);
System.Net.Quic (1)
System\Net\Quic\Internal\MsQuicApi.cs (1)
82
if (!
Socket
.OSSupportsIPv6)
System.Net.Requests (13)
System\Net\FtpControlStream.cs (7)
31
private
Socket
? _dataSocket;
89
Socket
? socket = _dataSocket;
108
Socket
listenSocket = connection._dataSocket!;
741
Socket
listenSocket = _dataSocket!;
1165
private static
Socket
CreateFtpDataSocket(
Socket
templateSocket)
1168
Socket
socket = new Socket(templateSocket.AddressFamily, templateSocket.SocketType, templateSocket.ProtocolType);
System\Net\FtpWebRequest.cs (2)
958
var
client = new Socket(SocketType.Stream, ProtocolType.Tcp);
975
var
client = new Socket(SocketType.Stream, ProtocolType.Tcp);
System\Net\HttpWebRequest.cs (3)
1760
var
socket = new Socket(SocketType.Stream, ProtocolType.Tcp);
1783
static void BindHelper(ServicePoint servicePoint, ref IPAddress[] addresses,
Socket
socket, int port)
1830
using (cancellationToken.UnsafeRegister(s => ((
Socket
)s!).Dispose(), socket))
System\Net\NetworkStreamWrapper.cs (1)
39
internal
Socket
Socket
System.Net.Sockets (318)
System\Net\Sockets\NetEventSource.Sockets.cs (4)
19
public static void Accepted(
Socket
socket, object? remoteEp, object? localEp) =>
27
public static void Connected(
Socket
socket, object? localEp, object? remoteEp) =>
35
public static void ConnectedAsyncDns(
Socket
socket) =>
43
public static void NotLoggedFile(string filePath,
Socket
socket, SocketAsyncOperation completedOperation) =>
System\Net\Sockets\NetworkStream.cs (16)
15
private readonly
Socket
_streamSocket;
30
public NetworkStream(
Socket
socket)
35
public NetworkStream(
Socket
socket, bool ownsSocket)
40
public NetworkStream(
Socket
socket, FileAccess access)
45
public NetworkStream(
Socket
socket, FileAccess access, bool ownsSocket)
85
public
Socket
Socket => _streamSocket;
229
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
250
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
275
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
299
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
322
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
349
private int _closeTimeout =
Socket
.DefaultCloseTimeout; // -1 = respect linger options
435
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
470
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
501
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
533
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
System\Net\Sockets\Socket.cs (128)
69
private 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"/>.
172
if (!
Socket
.OSSupportsUnixDomainSockets) throw new PlatformNotSupportedException();
206
if (!
Socket
.OSSupportsUnixDomainSockets) throw new PlatformNotSupportedException();
832
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
878
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
903
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
934
if (!
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.
1029
public
Socket
Accept()
1031
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1092
Socket
socket = CreateAcceptSocket(acceptedSocketHandle, _rightEndPoint.Create(socketAddress));
1100
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1107
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1114
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1121
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1128
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1141
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1179
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1192
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1233
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1243
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1270
if (!
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>
1298
if (!
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>
1326
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1345
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1383
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1390
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1397
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1410
/// <exception cref="ObjectDisposedException">The <see cref="
Socket
"/> has been closed.</exception>
1413
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1427
/// <exception cref="ObjectDisposedException">The <see cref="
Socket
"/> has been closed.</exception>
1430
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1470
/// <exception cref="ObjectDisposedException">The <see cref="
Socket
"/> has been closed.</exception>
1473
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1502
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1509
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1516
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1524
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1537
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1571
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1581
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1608
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1615
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1628
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1667
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1736
/// <exception cref="ObjectDisposedException">The <see cref="
Socket
"/> object has been closed.</exception>
1739
/// <see cref="
Socket
.ReceiveMessageFrom(Span{byte}, ref SocketFlags, ref EndPoint, out IPPacketInformation)"/>
1742
/// <para>The <see cref="
Socket
"/> object is not in blocking mode and cannot accept this synchronous call.</para>
1746
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1808
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1889
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1896
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1903
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
1916
/// <exception cref="ObjectDisposedException">The <see cref="
Socket
"/> has been closed.</exception>
1931
/// <exception cref="ObjectDisposedException">The <see cref="
Socket
"/> has been closed.</exception>
1934
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2014
/// <exception cref="ObjectDisposedException">The <see cref="
Socket
"/> has been closed.</exception>
2017
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2162
/// <exception cref="ObjectDisposedException">The <see cref="
Socket
"/> has been closed.</exception>
2165
/// In general, the SetSocketOption method should be used whenever setting a <see cref="
Socket
"/> option.
2282
/// <exception cref="ObjectDisposedException">The <see cref="
Socket
"/> has been closed.</exception>
2285
/// In general, the GetSocketOption method should be used whenever getting a <see cref="
Socket
"/> option.
2328
/// <summary>Determines the status of the <see cref="
Socket
"/>.</summary>
2332
/// The status of the <see cref="
Socket
"/> based on the polling mode value passed in the <paramref name="mode"/> parameter.
2342
/// <exception cref="ObjectDisposedException">The <see cref="
Socket
"/> has been closed.</exception>
2345
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2362
/// <summary>Determines the status of the <see cref="
Socket
"/>.</summary>
2366
/// The status of the <see cref="
Socket
"/> based on the polling mode value passed in the <paramref name="mode"/> parameter.
2377
/// <exception cref="ObjectDisposedException">The <see cref="
Socket
"/> has been closed.</exception>
2382
/// <param name="checkRead">An <see cref="IList"/> of <see cref="
Socket
"/> instances to check for readability.</param>
2383
/// <param name="checkWrite">An <see cref="IList"/> of <see cref="
Socket
"/> instances to check for writability.</param>
2384
/// <param name="checkError">An <see cref="IList"/> of <see cref="
Socket
"/> instances to check for errors.</param>
2392
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2424
/// <param name="checkRead">An <see cref="IList"/> of <see cref="
Socket
"/> instances to check for readability.</param>
2425
/// <param name="checkWrite">An <see cref="IList"/> of <see cref="
Socket
"/> instances to check for writability.</param>
2426
/// <param name="checkError">An <see cref="IList"/> of <see cref="
Socket
"/> instances to check for errors.</param>
2492
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2502
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2520
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2529
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2551
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2558
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2576
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2590
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2599
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2617
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2625
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2647
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2665
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2688
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2708
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2728
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2747
public
Socket
EndAccept(IAsyncResult asyncResult) => TaskToAsyncResult.End<
Socket
>(asyncResult);
2752
private async Task<(
Socket
s, byte[] buffer, int bytesReceived)> AcceptAndReceiveHelperAsync(
Socket
? acceptSocket, int receiveSize)
2756
Socket
s = await AcceptAsync(acceptSocket).ConfigureAwait(false);
2785
public IAsyncResult BeginAccept(
Socket
? acceptSocket, int receiveSize, AsyncCallback? callback, object? state) =>
2788
public
Socket
EndAccept(out byte[] buffer, IAsyncResult asyncResult)
2790
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2792
Socket
socket = EndAccept(out byte[] innerBuffer, out int bytesTransferred, asyncResult);
2798
public
Socket
EndAccept(out byte[] buffer, out int bytesTransferred, IAsyncResult asyncResult)
2800
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
2802
Socket
s;
2803
(s, buffer, bytesTransferred) = TaskToAsyncResult.End<(
Socket
, byte[], int)>(asyncResult);
3004
Socket
? attemptSocket = dnsEP.AddressFamily != AddressFamily.Unspecified ? new Socket(dnsEP.AddressFamily, socketType, protocolType) : null;
3019
Socket
attemptSocket = new Socket(endPointSnapshot.AddressFamily, socketType, protocolType);
3780
internal
Socket
CreateAcceptSocket(SafeSocketHandle fd, EndPoint? remoteEP)
3784
Socket
socket = new Socket(fd, loadPropertiesFromHandle: false);
3788
internal
Socket
UpdateAcceptSocket(
Socket
socket, EndPoint? remoteEP)
4052
Socket
socket = (
Socket
)socketList[i]!;
System\Net\Sockets\Socket.Tasks.cs (40)
32
public Task<
Socket
> AcceptAsync() => AcceptAsync((
Socket
?)null, CancellationToken.None).AsTask();
39
public ValueTask<
Socket
> AcceptAsync(CancellationToken cancellationToken) => AcceptAsync((
Socket
?)null, cancellationToken);
46
public Task<
Socket
> AcceptAsync(
Socket
? acceptSocket) => AcceptAsync(acceptSocket, CancellationToken.None).AsTask();
54
public ValueTask<
Socket
> AcceptAsync(
Socket
? acceptSocket, CancellationToken cancellationToken)
58
return ValueTask.FromCanceled<
Socket
>(cancellationToken);
352
saea.Completed += (s, e) => CompleteSendReceive((
Socket
)s!, (TaskSocketAsyncEventArgs<int>)e, isReceive: true);
616
saea.Completed += (s, e) => CompleteSendReceive((
Socket
)s!, (TaskSocketAsyncEventArgs<int>)e, isReceive: false);
725
/// Sends the file <paramref name="fileName"/> to a connected <see cref="
Socket
"/> object.
729
/// <exception cref="ObjectDisposedException">The <see cref="
Socket
"/> object has been closed.</exception>
730
/// <exception cref="NotSupportedException">The <see cref="
Socket
"/> object is not connected to a remote host.</exception>
739
/// Sends the file <paramref name="fileName"/> and buffers of data to a connected <see cref="
Socket
"/> object
747
/// <exception cref="ObjectDisposedException">The <see cref="
Socket
"/> object has been closed.</exception>
748
/// <exception cref="NotSupportedException">The <see cref="
Socket
"/> object is not connected to a remote host.</exception>
894
private static void CompleteSendReceive(
Socket
s, TaskSocketAsyncEventArgs<int> saea, bool isReceive)
999
internal sealed class AwaitableSocketAsyncEventArgs : SocketAsyncEventArgs, IValueTaskSource, IValueTaskSource<int>, IValueTaskSource<
Socket
>, IValueTaskSource<SocketReceiveFromResult>, IValueTaskSource<SocketReceiveMessageFromResult>
1002
private readonly
Socket
_owner;
1011
public AwaitableSocketAsyncEventArgs(
Socket
owner, bool isReceiveForCaching) :
1043
public ValueTask<
Socket
> AcceptAsync(
Socket
socket, CancellationToken cancellationToken)
1048
return new ValueTask<
Socket
>(this, _mrvtsc.Version);
1051
Socket
acceptSocket = AcceptSocket!;
1059
new ValueTask<
Socket
>(acceptSocket) :
1060
ValueTask.FromException<
Socket
>(CreateException(error));
1065
public ValueTask<int> ReceiveAsync(
Socket
socket, CancellationToken cancellationToken)
1083
public ValueTask<SocketReceiveFromResult> ReceiveFromAsync(
Socket
socket, CancellationToken cancellationToken)
1102
internal ValueTask<int> ReceiveFromSocketAddressAsync(
Socket
socket, CancellationToken cancellationToken)
1120
public ValueTask<SocketReceiveMessageFromResult> ReceiveMessageFromAsync(
Socket
socket, CancellationToken cancellationToken)
1143
public ValueTask<int> SendAsync(
Socket
socket, CancellationToken cancellationToken)
1161
public ValueTask SendAsyncForNetworkStream(
Socket
socket, CancellationToken cancellationToken)
1178
public ValueTask SendPacketsAsync(
Socket
socket, CancellationToken cancellationToken)
1195
public ValueTask<int> SendToAsync(
Socket
socket, CancellationToken cancellationToken)
1213
public ValueTask ConnectAsync(
Socket
socket, bool saeaCancelable)
1237
public ValueTask DisconnectAsync(
Socket
socket, CancellationToken cancellationToken)
1306
Socket
IValueTaskSource<
Socket
>.GetResult(short token)
1314
Socket
acceptSocket = AcceptSocket!;
System\Net\Sockets\Socket.Unix.cs (5)
193
private
Socket
? GetOrCreateAcceptSocket(
Socket
? acceptSocket, bool checkDisconnected, string propertyName, out SafeSocketHandle? handle)
273
internal
Socket
CopyStateFromSource(
Socket
source)
297
foreach (PropertyInfo pi in typeof(
Socket
).GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly))
System\Net\Sockets\SocketAsyncContext.Unix.cs (12)
1282
[DynamicDependency("set_PreferInlineCompletions", typeof(
Socket
))]
1375
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException();
1512
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException();
1606
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException();
1639
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException();
1751
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException();
1820
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException();
1857
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException();
1949
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException();
1981
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException();
2060
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException();
2130
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException();
System\Net\Sockets\SocketAsyncEventArgs.cs (13)
17
private
Socket
? _acceptSocket;
18
private
Socket
? _connectSocket;
76
private
Socket
? _currentSocket;
106
public
Socket
? AcceptSocket
112
public
Socket
? ConnectSocket
546
internal void StartOperationCommon(
Socket
? socket, SocketAsyncOperation operation)
577
_acceptAddressBufferCount = 2 * (
Socket
.GetAddressSize(_currentSocket!._rightEndPoint!) + 16);
635
Socket
? currentSocket = _currentSocket;
711
Socket
? tempSocketIPv4 = null, tempSocketIPv6 = null;
720
Socket
? attemptSocket = null;
738
attemptSocket = tempSocketIPv6 ??= (
Socket
.OSSupportsIPv6 ? new Socket(AddressFamily.InterNetworkV6, socketType, protocolType) : null);
747
attemptSocket = tempSocketIPv4 ??= (
Socket
.OSSupportsIPv4 ? new Socket(AddressFamily.InterNetwork, socketType, protocolType) : null);
777
using (cancellationToken.UnsafeRegister(s =>
Socket
.CancelConnectAsync((SocketAsyncEventArgs)s!), internalArgs))
System\Net\Sockets\SocketAsyncEventArgs.Unix.cs (7)
46
internal unsafe SocketError DoOperationAccept(
Socket
_ /*socket*/, SafeSocketHandle handle, SafeSocketHandle? acceptHandle, CancellationToken cancellationToken)
74
internal unsafe SocketError DoOperationConnectEx(
Socket
_ /*socket*/, SafeSocketHandle handle)
94
internal SocketError DoOperationDisconnect(
Socket
socket, SafeSocketHandle handle, CancellationToken _ /*cancellationToken*/)
196
internal unsafe SocketError DoOperationReceiveMessageFrom(
Socket
socket, SafeSocketHandle handle, CancellationToken cancellationToken)
203
Socket
.GetIPProtocolInformation(socket.AddressFamily, _socketAddress!, out isIPv4, out isIPv6);
244
internal SocketError DoOperationSendPackets(
Socket
socket, SafeSocketHandle _1 /*handle*/, CancellationToken cancellationToken)
351
Socket
acceptedSocket = _currentSocket!.CreateAcceptSocket(
System\Net\Sockets\SocketPal.Unix.cs (29)
35
public static void CheckDualModePacketInfoSupport(
Socket
socket)
1304
public static SocketError ReceiveMessageFrom(
Socket
socket, SafeSocketHandle handle, byte[] buffer, int offset, int count, ref SocketFlags socketFlags, SocketAddress socketAddress, out SocketAddress receiveAddress, out IPPacketInformation ipPacketInformation, out int bytesTransferred)
1309
Socket
.GetIPProtocolInformation(socket.AddressFamily, socketAddress, out isIPv4, out isIPv6);
1330
public static SocketError ReceiveMessageFrom(
Socket
socket, SafeSocketHandle handle, Span<byte> buffer, ref SocketFlags socketFlags, SocketAddress socketAddress, out SocketAddress receiveAddress, out IPPacketInformation ipPacketInformation, out int bytesTransferred)
1335
Socket
.GetIPProtocolInformation(socket.AddressFamily, socketAddress, out isIPv4, out isIPv6);
1583
public static void SetReceivingDualModeIPv4PacketInformation(
Socket
socket)
1594
public static void SetIPProtectionLevel(
Socket
socket, SocketOptionLevel optionLevel, int protectionLevel)
1857
Socket
.SocketListDangerousReleaseRefs(checkRead, ref refsAdded);
1858
Socket
.SocketListDangerousReleaseRefs(checkWrite, ref refsAdded);
1859
Socket
.SocketListDangerousReleaseRefs(checkError, ref refsAdded);
1878
Socket
.SocketListDangerousReleaseRefs(checkRead, ref refsAdded);
1879
Socket
.SocketListDangerousReleaseRefs(checkWrite, ref refsAdded);
1880
Socket
.SocketListDangerousReleaseRefs(checkError, ref refsAdded);
1897
Socket
? socket = socketList[i] as
Socket
;
1900
throw new ArgumentException(SR.Format(SR.net_sockets_select, socket?.GetType().FullName ?? "null", typeof(
Socket
).FullName), nameof(socketList));
1965
Socket
.SocketListDangerousReleaseRefs(checkRead, ref refsAdded);
1966
Socket
.SocketListDangerousReleaseRefs(checkWrite, ref refsAdded);
1967
Socket
.SocketListDangerousReleaseRefs(checkError, ref refsAdded);
1986
Socket
.SocketListDangerousReleaseRefs(checkRead, ref refsAdded);
1987
Socket
.SocketListDangerousReleaseRefs(checkWrite, ref refsAdded);
1988
Socket
.SocketListDangerousReleaseRefs(checkError, ref refsAdded);
2004
Socket
? socket = socketList[i] as
Socket
;
2007
throw new ArgumentException(SR.Format(SR.net_sockets_select, socket?.GetType().FullName ?? "null", typeof(
Socket
).FullName), nameof(socketList));
2041
Socket
socket = (
Socket
)socketList[i]!;
2082
Socket
socket, TransmitFileOptions options, SendPacketsElement[] elements, SafeFileHandle[] fileHandles, CancellationToken cancellationToken, Action<long, SocketError> callback)
2157
internal static SocketError Disconnect(
Socket
socket, SafeSocketHandle handle, bool reuseSocket)
System\Net\Sockets\SocketTaskExtensions.cs (22)
15
public static Task<
Socket
> AcceptAsync(this
Socket
socket) =>
18
public static Task<
Socket
> AcceptAsync(this
Socket
socket,
Socket
? acceptSocket) =>
22
public static Task ConnectAsync(this
Socket
socket, EndPoint remoteEP) =>
25
public static ValueTask ConnectAsync(this
Socket
socket, EndPoint remoteEP, CancellationToken cancellationToken) =>
28
public static Task ConnectAsync(this
Socket
socket, IPAddress address, int port) =>
31
public static ValueTask ConnectAsync(this
Socket
socket, IPAddress address, int port, CancellationToken cancellationToken) =>
34
public static Task ConnectAsync(this
Socket
socket, IPAddress[] addresses, int port) =>
37
public static ValueTask ConnectAsync(this
Socket
socket, IPAddress[] addresses, int port, CancellationToken cancellationToken) =>
40
public static Task ConnectAsync(this
Socket
socket, string host, int port) =>
43
public static ValueTask ConnectAsync(this
Socket
socket, string host, int port, CancellationToken cancellationToken) =>
47
public static Task<int> ReceiveAsync(this
Socket
socket, ArraySegment<byte> buffer, SocketFlags socketFlags) =>
50
public static ValueTask<int> ReceiveAsync(this
Socket
socket, Memory<byte> buffer, SocketFlags socketFlags, CancellationToken cancellationToken = default) =>
53
public static Task<int> ReceiveAsync(this
Socket
socket, IList<ArraySegment<byte>> buffers, SocketFlags socketFlags) =>
56
public static Task<SocketReceiveFromResult> ReceiveFromAsync(this
Socket
socket, ArraySegment<byte> buffer, SocketFlags socketFlags, EndPoint remoteEndPoint) =>
59
public static Task<SocketReceiveMessageFromResult> ReceiveMessageFromAsync(this
Socket
socket, ArraySegment<byte> buffer, SocketFlags socketFlags, EndPoint remoteEndPoint) =>
63
public static Task<int> SendAsync(this
Socket
socket, ArraySegment<byte> buffer, SocketFlags socketFlags) =>
66
public static ValueTask<int> SendAsync(this
Socket
socket, ReadOnlyMemory<byte> buffer, SocketFlags socketFlags, CancellationToken cancellationToken = default) =>
69
public static Task<int> SendAsync(this
Socket
socket, IList<ArraySegment<byte>> buffers, SocketFlags socketFlags) =>
73
public static Task<int> SendToAsync(this
Socket
socket, ArraySegment<byte> buffer, SocketFlags socketFlags, EndPoint remoteEP) =>
System\Net\Sockets\TCPClient.cs (9)
18
private
Socket
_clientSocket = null!; // initialized by helper called from ctor
79
internal TcpClient(
Socket
acceptedSocket)
95
public
Socket
Client
126
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
145
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
162
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
175
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
242
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
282
Socket
chkClientSocket = Volatile.Read(ref _clientSocket);
System\Net\Sockets\TCPListener.cs (12)
17
private
Socket
? _serverSocket;
62
public
Socket
Server
187
public
Socket
AcceptSocket()
208
Socket
acceptedSocket = _serverSocket!.Accept();
215
public
Socket
EndAcceptSocket(IAsyncResult asyncResult) =>
216
EndAcceptCore<
Socket
>(asyncResult);
224
public Task<
Socket
> AcceptSocketAsync() => AcceptSocketAsync(CancellationToken.None).AsTask();
226
public ValueTask<
Socket
> AcceptSocketAsync(CancellationToken cancellationToken)
242
static async ValueTask<TcpClient> WaitAndWrap(ValueTask<
Socket
> task) =>
255
if (
Socket
.OSSupportsIPv6)
293
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
303
throw new ObjectDisposedException(typeof(
Socket
).FullName);
System\Net\Sockets\UDPClient.cs (20)
18
private
Socket
_clientSocket = null!; // initialized by helper called from ctor
117
public
Socket
Client
233
Socket
chkClientSocket = _clientSocket;
287
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
304
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
361
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
377
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
639
/// <exception cref="ObjectDisposedException">The underlying <see cref="
Socket
"/> has been closed.</exception>
688
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
705
Socket
? ipv6Socket = null;
706
Socket
? ipv4Socket = null;
712
if (
Socket
.OSSupportsIPv4)
716
if (
Socket
.OSSupportsIPv6)
803
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
820
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
833
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
856
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
892
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
936
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
962
if (!
Socket
.OSSupportsThreads) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
System\Net\Sockets\UnixDomainSocketEndPoint.cs (1)
59
if (!
Socket
.OSSupportsUnixDomainSockets)
System.ServiceModel.UnixDomainSocket (5)
System\ServiceModel\Channels\SocketAwaitableEventArgs.cs (2)
31
public ValueTask<int> ReceiveAsync(
Socket
socket, Memory<byte> buffer)
48
public ValueTask SendAsync(
Socket
socket, ReadOnlyMemory<byte> memory)
System\ServiceModel\Channels\SocketConnection.cs (3)
19
private
Socket
_socket;
54
public SocketConnection(
Socket
socket, int bufferSize)
774
Socket
socket = null;
VBCSCompiler.UnitTests (5)
NamedPipeTestUtil.cs (5)
39
private static
Socket
GetSocket(object sharedServer)
42
var
socket = (
Socket
?)listeningSocketProperty?.GetValue(sharedServer, null);
51
private static
Socket
? GetSocketForPipeName(string pipeName)
90
var
socket = GetSocket(sharedServer);