228 instantiations of IPEndPoint
ClientSample (2)
Tcp\TcpHubConnectionBuilderExtensions.cs (2)
28endPoint = new IPEndPoint(IPAddress.Loopback, uri.Port); 32endPoint = new IPEndPoint(IPAddress.Parse(uri.Host), uri.Port);
dotnet-svcutil-lib (2)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\CoreClrSocketConnection.cs (2)
928socket.Connect(new IPEndPoint(address, port)); 945await socket.ConnectAsync(new IPEndPoint(address, port));
http2cat (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
66var endpoint = new IPEndPoint(ip, address.Port);
HttpsPolicySample (2)
Startup.cs (2)
52options.Listen(new IPEndPoint(IPAddress.Loopback, 5001), listenOptions => 56options.Listen(new IPEndPoint(IPAddress.Loopback, 5000), listenOptions =>
IIS.Common.TestLib (1)
TestConnections.cs (1)
249socket.Connect(new IPEndPoint(address, port));
IIS.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\AspNetCorePortTests.cs (1)
165socket.Bind(new IPEndPoint(IPAddress.Loopback, port));
src\Shared\Http2cat\Http2CatHostedService.cs (1)
66var endpoint = new IPEndPoint(ip, address.Port);
IIS.LongTests (2)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1454socket.Bind(new IPEndPoint(IPAddress.Loopback, port));
src\Shared\Http2cat\Http2CatHostedService.cs (1)
66var endpoint = new IPEndPoint(ip, address.Port);
IIS.NewHandler.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1454socket.Bind(new IPEndPoint(IPAddress.Loopback, port));
src\Shared\Http2cat\Http2CatHostedService.cs (1)
66var endpoint = new IPEndPoint(ip, address.Port);
IIS.NewShim.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1454socket.Bind(new IPEndPoint(IPAddress.Loopback, port));
src\Shared\Http2cat\Http2CatHostedService.cs (1)
66var endpoint = new IPEndPoint(ip, address.Port);
IISExpress.FunctionalTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\AspNetCorePortTests.cs (1)
165socket.Bind(new IPEndPoint(IPAddress.Loopback, port));
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1454socket.Bind(new IPEndPoint(IPAddress.Loopback, port));
src\Shared\Http2cat\Http2CatHostedService.cs (1)
66var endpoint = new IPEndPoint(ip, address.Port);
InMemory.FunctionalTests (32)
ConnectionLimitTests.cs (1)
237var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0));
ConnectionMiddlewareTests.cs (8)
39var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 135var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 158var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 184var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 211var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 243var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 271var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)) 302var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0))
HttpProtocolSelectionTests.cs (2)
62var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)) 81var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0))
KestrelMetricsTests.cs (5)
46var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 109var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 323var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 441var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 493var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0));
ResponseDrainingTests.cs (2)
17new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)), 18new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)).UsePassThrough()
ResponseTests.cs (8)
4377options.CodeBackedListenOptions.Add(new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)) 4410options.CodeBackedListenOptions.Add(new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)) 4447options.CodeBackedListenOptions.Add(new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)) 4478new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)) { Protocols = HttpProtocols.Http1 })) 4505options.CodeBackedListenOptions.Add(new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)) 4509options.CodeBackedListenOptions.Add(new ListenOptions(new IPEndPoint(IPAddress.Loopback, 1)) 4545options.CodeBackedListenOptions.Add(new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)) 4696options => options.CodeBackedListenOptions.Add(new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0))),
src\Servers\Kestrel\shared\test\CertHelper.cs (1)
50listener.Bind(new IPEndPoint(IPAddress.Loopback, 0));
src\Servers\Kestrel\shared\test\TestConnection.cs (1)
69socket.Connect(new IPEndPoint(address, port));
TestTransport\InMemoryTransportConnection.cs (2)
29LocalEndPoint = new IPEndPoint(IPAddress.Loopback, 0); 30RemoteEndPoint = new IPEndPoint(IPAddress.Loopback, 0);
TestTransport\TestServer.cs (2)
44: this(app, context, new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0))) 57var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0))
Microsoft.AspNetCore.Http.Extensions.Tests (4)
RequestDelegateFactoryTests.cs (2)
333new object[] { (Action<HttpContext, IPEndPoint[]>)Store, new[] { "127.0.0.1:80" },new[] { new IPEndPoint(IPAddress.Loopback, 80) } }, 384new object[] { (Action<HttpContext, IPEndPoint>)Store, "127.0.0.1:80", new IPEndPoint(IPAddress.Loopback, 80) },
RequestDelegateGenerator\RequestDelegateCreationTests.Arrays.cs (1)
140new object[] { "IPEndPoint[]", new[] { "127.0.0.1:80" },new[] { new IPEndPoint(IPAddress.Loopback, 80) } },
RequestDelegateGenerator\RequestDelegateCreationTests.TryParse.cs (1)
51new object[] { "IPEndPoint", "127.0.0.1:80", new IPEndPoint(IPAddress.Loopback, 80) },
Microsoft.AspNetCore.HttpOverrides (2)
ForwardedHeadersMiddleware.cs (2)
212RemoteIpAndPort = connection.RemoteIpAddress != null ? new IPEndPoint(connection.RemoteIpAddress, connection.RemotePort) : null, 310requestHeaders[_options.OriginalForHeaderName] = new IPEndPoint(connection.RemoteIpAddress, connection.RemotePort).ToString();
Microsoft.AspNetCore.HttpOverrides.Tests (1)
ForwardedHeadersMiddlewareTest.cs (1)
182Assert.Equal(new IPEndPoint(IPAddress.Parse(originalIp), 99).ToString(),
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
66var endpoint = new IPEndPoint(ip, address.Port);
Microsoft.AspNetCore.Server.IntegrationTesting (3)
Common\TestPortHelper.cs (2)
26socket.Bind(new IPEndPoint(IPAddress.Loopback, 0)); 44socket.Bind(new IPEndPoint(IPAddress.Loopback, port));
Deployers\NginxDeployer.cs (1)
46_portSelector.Bind(new IPEndPoint(IPAddress.Loopback, 0));
Microsoft.AspNetCore.Server.Kestrel.Core (7)
AnyIPListenOptions.cs (2)
14: base(new IPEndPoint(IPAddress.IPv6Any, port)) 41EndPoint = new IPEndPoint(IPAddress.Any, IPEndPoint.Port);
Internal\AddressBinder.cs (1)
82endpoint = new IPEndPoint(ip, address.Port);
KestrelConfigurationLoader.cs (1)
103return Endpoint(new IPEndPoint(address, port), configure);
KestrelServerOptions.cs (1)
485Listen(new IPEndPoint(address, port), configure);
ListenOptions.cs (1)
236var options = new ListenOptions(new IPEndPoint(address, IPEndPoint!.Port))
LocalhostListenOptions.cs (1)
13: base(new IPEndPoint(IPAddress.Loopback, port))
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (29)
KestrelServerOptionsTests.cs (1)
38options.Listen(new IPEndPoint(IPAddress.Loopback, 5000), opt =>
KestrelServerTests.cs (25)
107serverOptions.Listen(new IPEndPoint(IPAddress.Loopback, 0)); 342serverOptions.Listen(new IPEndPoint(IPAddress.Loopback, 0)); 358var endpoint = new IPEndPoint(IPAddress.Loopback, 0); 379serverOptions.Listen(new IPEndPoint(IPAddress.Loopback, 0), c => 399var endpoint = new IPEndPoint(IPAddress.Loopback, 0); 543new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)) 600new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)) 660new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)) 722new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)) 826mockTransportFactory.Verify(f => f.BindAsync(new IPEndPoint(IPAddress.IPv6Any, 5000), It.IsAny<CancellationToken>()), Times.Once); 827mockTransportFactory.Verify(f => f.BindAsync(new IPEndPoint(IPAddress.IPv6Any, 5001), It.IsAny<CancellationToken>()), Times.Once); 828mockTransportFactory.Verify(f => f.BindAsync(new IPEndPoint(IPAddress.IPv6Any, 5002), It.IsAny<CancellationToken>()), Times.Never); 829mockTransportFactory.Verify(f => f.BindAsync(new IPEndPoint(IPAddress.IPv6Any, 5003), It.IsAny<CancellationToken>()), Times.Never); 847mockTransportFactory.Verify(f => f.BindAsync(new IPEndPoint(IPAddress.IPv6Any, 5000), It.IsAny<CancellationToken>()), Times.Once); 848mockTransportFactory.Verify(f => f.BindAsync(new IPEndPoint(IPAddress.IPv6Any, 5001), It.IsAny<CancellationToken>()), Times.Once); 849mockTransportFactory.Verify(f => f.BindAsync(new IPEndPoint(IPAddress.IPv6Any, 5002), It.IsAny<CancellationToken>()), Times.Once); 850mockTransportFactory.Verify(f => f.BindAsync(new IPEndPoint(IPAddress.IPv6Any, 5003), It.IsAny<CancellationToken>()), Times.Once); 876mockTransportFactory.Verify(f => f.BindAsync(new IPEndPoint(IPAddress.IPv6Any, 5000), It.IsAny<CancellationToken>()), Times.Once); 877mockTransportFactory.Verify(f => f.BindAsync(new IPEndPoint(IPAddress.IPv6Any, 5001), It.IsAny<CancellationToken>()), Times.Once); 878mockTransportFactory.Verify(f => f.BindAsync(new IPEndPoint(IPAddress.IPv6Any, 5002), It.IsAny<CancellationToken>()), Times.Once); 879mockTransportFactory.Verify(f => f.BindAsync(new IPEndPoint(IPAddress.IPv6Any, 5003), It.IsAny<CancellationToken>()), Times.Exactly(2)); 964mockTransportFactory.Verify(f => f.BindAsync(new IPEndPoint(IPAddress.IPv6Any, 5000), It.IsAny<CancellationToken>()), Times.Once); 965mockTransportFactory.Verify(f => f.BindAsync(new IPEndPoint(IPAddress.IPv6Any, 5001), It.IsAny<CancellationToken>()), Times.Once); 1000resolvedEndPoint = new IPEndPoint(new IPAddress(ipEndPoint.Address.GetAddressBytes()), port); 1052resolvedEndPoint = new IPEndPoint(new IPAddress(ipEndPoint.Address.GetAddressBytes()), port);
ListenOptionsTests.cs (1)
18var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0));
src\Servers\Kestrel\shared\test\CertHelper.cs (1)
50listener.Bind(new IPEndPoint(IPAddress.Loopback, 0));
src\Servers\Kestrel\shared\test\TestConnection.cs (1)
69socket.Connect(new IPEndPoint(address, port));
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (6)
QuicConnectionListenerTests.cs (1)
288var endpoint = new IPEndPoint(IPAddress.Loopback, 0);
QuicTestHelpers.cs (2)
59var endpoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), port); 73var endpoint = new IPEndPoint(IPAddress.Loopback, port);
QuicTransportFactoryTests.cs (3)
32var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => quicTransportFactory.BindAsync(new IPEndPoint(0, 0), features: null, cancellationToken: CancellationToken.None).AsTask()).DefaultTimeout(); 49var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => quicTransportFactory.BindAsync(new IPEndPoint(0, 0), features: features, cancellationToken: CancellationToken.None).AsTask()).DefaultTimeout(); 72await quicTransportFactory.BindAsync(new IPEndPoint(0, 0), features: features, cancellationToken: CancellationToken.None).AsTask().DefaultTimeout();
Microsoft.AspNetCore.SignalR.Client.Tests (1)
HttpConnectionFactoryTests.cs (1)
53var ex = await Assert.ThrowsAsync<NotSupportedException>(async () => await factory.ConnectAsync(new IPEndPoint(IPAddress.Loopback, 0)));
Microsoft.AspNetCore.Testing (2)
ServiceFakesWebHostExtensions.cs (2)
36.UseKestrel(options => options.Listen(new IPEndPoint(IPAddress.Loopback, 0))); 53options.Listen(new IPEndPoint(IPAddress.Loopback, 0), listenOptions =>
Microsoft.Extensions.Diagnostics.Probes.Tests (1)
TcpEndpointProbesServiceTests.cs (1)
103tcpClient.Connect(new IPEndPoint(IPAddress.Loopback, port));
Microsoft.Extensions.ServiceDiscovery (2)
Configuration\ConfigurationServiceEndpointProvider.cs (1)
209endPoint = new IPEndPoint(ip, port);
PassThrough\PassThroughServiceEndpointProviderFactory.cs (1)
53endPoint = new IPEndPoint(ip, port);
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (4)
DnsSrvServiceEndpointResolverTests.cs (4)
120Assert.Equal(new IPEndPoint(IPAddress.Parse("10.10.10.10"), 8888), eps[0].EndPoint); 121Assert.Equal(new IPEndPoint(IPAddress.IPv6Loopback, 9999), eps[1].EndPoint); 212Assert.Equal(new IPEndPoint(IPAddress.Parse("10.10.10.10"), 8888), eps[0].EndPoint); 213Assert.Equal(new IPEndPoint(IPAddress.IPv6Loopback, 9999), eps[1].EndPoint);
Microsoft.Extensions.ServiceDiscovery.Tests (11)
ConfigurationServiceEndpointResolverTests.cs (2)
371Assert.Equal(new IPEndPoint(IPAddress.Loopback, 3333), initialResult.EndpointSource.Endpoints[1].EndPoint); 418Assert.Equal(new IPEndPoint(IPAddress.Loopback, 3333), initialResult.EndpointSource.Endpoints[1].EndPoint);
ServiceEndpointResolverTests.cs (9)
91collection.Endpoints.Add(ServiceEndpoint.Create(new IPEndPoint(IPAddress.Parse("127.1.1.1"), 8080))); 96collection.Endpoints.Add(ServiceEndpoint.Create(new IPEndPoint(IPAddress.Parse("127.1.1.2"), 8888))); 130Assert.Equal(new IPEndPoint(IPAddress.Parse("127.1.1.1"), 8080), endpoints[0]); 131Assert.Equal(new IPEndPoint(IPAddress.Parse("127.1.1.2"), 8888), endpoints[1]); 143collection.Endpoints.Add(ServiceEndpoint.Create(new IPEndPoint(IPAddress.Parse("127.1.1.1"), 8080))); 148collection.Endpoints.Add(ServiceEndpoint.Create(new IPEndPoint(IPAddress.Parse("127.1.1.2"), 8888))); 179collection.Endpoints.Add(ServiceEndpoint.Create(new IPEndPoint(IPAddress.Parse("127.1.1.1"), 8080))); 184collection.Endpoints.Add(ServiceEndpoint.Create(new IPEndPoint(IPAddress.Parse("127.1.1.2"), 8888))); 231collection.Endpoints.Add(ServiceEndpoint.Create(new IPEndPoint(IPAddress.Parse("127.1.1.1"), 8080)));
Microsoft.Gen.Logging.Generated.Tests (2)
LogPropertiesTests.cs (2)
97P7 = new IPEndPoint(IPAddress.Parse("192.168.10.1"), 42), 98P8 = new IPEndPoint(IPAddress.Parse("192.168.10.1"), 42),
Sockets.BindTests (39)
SocketTransportOptionsTests.cs (3)
86yield return new object[] { new IPEndPoint(IPAddress.Loopback, 0) }; 88yield return new object[] { new IPEndPoint(IPAddress.IPv6Loopback, 0) }; 107fileHandleSocket.Bind(new IPEndPoint(IPAddress.Loopback, 0));
src\Servers\Kestrel\shared\test\TestConnection.cs (1)
69socket.Connect(new IPEndPoint(address, port));
src\Servers\Kestrel\shared\test\TransportTestHelpers\IPv6SupportedConditionAttribute.cs (1)
26socket.Bind(new IPEndPoint(IPAddress.IPv6Loopback, 0));
src\Servers\Kestrel\shared\test\TransportTestHelpers\TestServer.cs (2)
42: this(app, context, new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0))) 54var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0))
src\Servers\Kestrel\test\BindTests\AddressRegistrationTests.cs (32)
344=> RunTestWithStaticPort(port => RegisterIPEndPoint_Success(new IPEndPoint(address, port), testUrl, port)); 540socket.Bind(new IPEndPoint(IPAddress.Loopback, 0)); 575socket.Bind(new IPEndPoint(IPAddress.IPv6Loopback, 0)); 613options.Listen(new IPEndPoint(IPAddress.Loopback, 0), listenOptions => 658options.Listen(new IPEndPoint(IPAddress.Loopback, 0), listenOptions => 700options.Listen(new IPEndPoint(IPAddress.Loopback, 0), listenOptions => 943socket.Bind(new IPEndPoint(IPAddress.IPv6Any, 0)); 952socket.Bind(new IPEndPoint(address, port)); 1022.Where(ip => CanBindAndConnectToEndpoint(new IPEndPoint(ip, 0))); 1047dataset.Add(new IPEndPoint(IPAddress.Loopback, 0), "http://127.0.0.1"); 1048dataset.Add(new IPEndPoint(IPAddress.Loopback, 0), "https://127.0.0.1"); 1051dataset.Add(new IPEndPoint(IPAddress.IPv6Loopback, 0), "http://[::1]"); 1052dataset.Add(new IPEndPoint(IPAddress.IPv6Loopback, 0), "https://[::1]"); 1055dataset.Add(new IPEndPoint(IPAddress.Any, 0), "http://127.0.0.1"); 1056dataset.Add(new IPEndPoint(IPAddress.Any, 0), "https://127.0.0.1"); 1059dataset.Add(new IPEndPoint(IPAddress.IPv6Any, 0), "http://127.0.0.1"); 1060dataset.Add(new IPEndPoint(IPAddress.IPv6Any, 0), "http://[::1]"); 1061dataset.Add(new IPEndPoint(IPAddress.IPv6Any, 0), "https://127.0.0.1"); 1062dataset.Add(new IPEndPoint(IPAddress.IPv6Any, 0), "https://[::1]"); 1067.Where(ip => CanBindAndConnectToEndpoint(new IPEndPoint(ip, 0))); 1071dataset.Add(new IPEndPoint(ip, 0), $"http://{ip}"); 1072dataset.Add(new IPEndPoint(ip, 0), $"https://{ip}"); 1078.Where(ip => CanBindAndConnectToEndpoint(new IPEndPoint(ip, 0))); 1082dataset.Add(new IPEndPoint(ip, 0), $"http://[{ip}]"); 1102{ new IPEndPoint(IPAddress.Loopback, 443), "https://127.0.0.1" }, 1103{ new IPEndPoint(IPAddress.IPv6Loopback, 443), "https://[::1]" }, 1104{ new IPEndPoint(IPAddress.Any, 443), "https://127.0.0.1" }, 1105{ new IPEndPoint(IPAddress.IPv6Any, 443), "https://[::1]" } 1126.Where(ip => CanBindAndConnectToEndpoint(new IPEndPoint(ip, 0))); 1162.Where(ip => CanBindAndConnectToEndpoint(new IPEndPoint(ip, 0))); 1202socket.Bind(new IPEndPoint(IPAddress.Loopback, 0)); 1252socket.Bind(new IPEndPoint(address, port));
Sockets.FunctionalTests (19)
src\Servers\Kestrel\shared\test\TestConnection.cs (1)
69socket.Connect(new IPEndPoint(address, port));
src\Servers\Kestrel\shared\test\TransportTestHelpers\IPv6SupportedConditionAttribute.cs (1)
26socket.Bind(new IPEndPoint(IPAddress.IPv6Loopback, 0));
src\Servers\Kestrel\shared\test\TransportTestHelpers\TestServer.cs (2)
42: this(app, context, new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0))) 54var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0))
src\Servers\Kestrel\test\FunctionalTests\ConnectionMiddlewareTests.cs (2)
21var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 51var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0));
src\Servers\Kestrel\test\FunctionalTests\ListenHandleTests.cs (1)
34_canListenToOpenTcpSocketHandleSocket.Bind(new IPEndPoint(IPAddress.Loopback, 0));
src\Servers\Kestrel\test\FunctionalTests\MaxRequestBufferSizeTests.cs (1)
317options.Listen(new IPEndPoint(IPAddress.Loopback, 0), listenOptions =>
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (6)
51{ "Loopback", () => new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)) }, 52{ "PassThrough", () => new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)).UsePassThrough() } 118socket.Connect(new IPEndPoint(IPAddress.Loopback, host.GetPort())); 570socket.Connect(new IPEndPoint(IPAddress.Loopback, host.GetPort())); 617socket.Connect(new IPEndPoint(IPAddress.Loopback, host.GetPort())); 711socket.Connect(new IPEndPoint(IPAddress.Loopback, host.GetPort()));
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (5)
38new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)), 39new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)).UsePassThrough() 877var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 954var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0)); 1041var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0));
System.Net.HttpListener (1)
System\Net\Managed\HttpEndPointListener.cs (1)
62_endpoint = new IPEndPoint(addr, port);
System.Net.NetworkInformation (2)
System\Net\NetworkInformation\StringParsingHelpers.Connections.cs (2)
290return new IPEndPoint(localIPAddress, localPort); 310return new IPEndPoint(ipAddress, port);
System.Net.Ping (2)
src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (1)
53return new IPEndPoint(GetIPAddress(socketAddressBuffer), SocketAddressPal.GetPort(socketAddressBuffer));
System\Net\NetworkInformation\Ping.RawSocket.cs (1)
52new IPEndPoint(address, 0), timeout, options,
System.Net.Primitives (3)
src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (1)
53return new IPEndPoint(GetIPAddress(socketAddressBuffer), SocketAddressPal.GetPort(socketAddressBuffer));
src\libraries\Common\src\System\Net\SocketAddressExtensions.cs (1)
20return new IPEndPoint(socketAddress.GetIPAddress(), socketAddress.GetPort());
System\Net\IPEndPoint.cs (1)
121result = new IPEndPoint(address, (int)port);
System.Net.Quic (2)
src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (1)
53return new IPEndPoint(GetIPAddress(socketAddressBuffer), SocketAddressPal.GetPort(socketAddressBuffer));
System\Net\Quic\QuicConnection.cs (1)
405QuicAddr remoteQuicAddress = new IPEndPoint(address, port).ToQuicAddr();
System.Net.Requests (4)
System\Net\FtpControlStream.cs (3)
706IPEndPoint localEndPoint = new IPEndPoint(((IPEndPoint)Socket.LocalEndPoint!).Address, 0); 709_passiveEndPoint = new IPEndPoint(ServerAddress, port); 1102IPEndPoint epListener = new IPEndPoint(((IPEndPoint)Socket.LocalEndPoint!).Address, 0);
System\Net\HttpWebRequest.cs (1)
1796IPEndPoint? endPoint = servicePoint.BindIPEndPointDelegate(servicePoint, new IPEndPoint(address, port), retryCount);
System.Net.Sockets (29)
src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (1)
53return new IPEndPoint(GetIPAddress(socketAddressBuffer), SocketAddressPal.GetPort(socketAddressBuffer));
src\libraries\Common\src\System\Net\IPEndPointStatics.cs (2)
9internal static readonly IPEndPoint Any = new IPEndPoint(IPAddress.Any, AnyPort); 10internal static readonly IPEndPoint IPv6Any = new IPEndPoint(IPAddress.IPv6Any, AnyPort);
src\libraries\Common\src\System\Net\SocketAddressExtensions.cs (1)
20return new IPEndPoint(socketAddress.GetIPAddress(), socketAddress.GetPort());
System\Net\Sockets\Socket.cs (10)
26private static readonly IPEndPoint s_IPEndPointIPv6 = new IPEndPoint(s_IPAddressAnyMapToIPv6, 0); 158_rightEndPoint = new IPEndPoint( 166_rightEndPoint = new IPEndPoint( 192_remoteEndPoint = new IPEndPoint( 200_remoteEndPoint = new IPEndPoint( 897IPEndPoint remoteEP = new IPEndPoint(address, port); 963Connect(new IPEndPoint(address, port)); 1867remoteEP = new IPEndPoint(socketAddress.GetIPAddress().MapToIPv6(), socketAddress.GetPort()); 1986remoteEP = new IPEndPoint(socketAddress.GetIPAddress().MapToIPv6(), socketAddress.GetPort()); 3340remoteEP = new IPEndPoint(addr, ip.Port);
System\Net\Sockets\Socket.Tasks.cs (4)
135public Task ConnectAsync(IPAddress address, int port) => ConnectAsync(new IPEndPoint(address, port)); 144public ValueTask ConnectAsync(IPAddress address, int port, CancellationToken cancellationToken) => ConnectAsync(new IPEndPoint(address, port), cancellationToken); 201endPoint = new IPEndPoint(address, port); 243new IPEndPoint(parsedAddress, port) :
System\Net\Sockets\SocketAsyncEventArgs.cs (3)
771internalArgs.RemoteEndPoint = new IPEndPoint(address, port); 968_remoteEndPoint = new IPEndPoint(_socketAddress.GetIPAddress().MapToIPv6(), _socketAddress.GetPort()); 990_remoteEndPoint = new IPEndPoint(_socketAddress.GetIPAddress().MapToIPv6(), _socketAddress.GetPort());
System\Net\Sockets\TCPClient.cs (1)
155IPEndPoint remoteEP = new IPEndPoint(address, port);
System\Net\Sockets\TCPListener.cs (2)
44_serverSocketEP = new IPEndPoint(localaddr, port); 57_serverSocketEP = new IPEndPoint(IPAddress.Any, port);
System\Net\Sockets\UDPClient.cs (5)
69localEP = new IPEndPoint(IPAddress.Any, port); 73localEP = new IPEndPoint(IPAddress.IPv6Any, port); 353ipEndPoint = new IPEndPoint(addresses[i], port); 753Connect(new IPEndPoint(address, port)); 813IPEndPoint endPoint = new IPEndPoint(addr, port);
352 references to IPEndPoint
Aspire.Dashboard (2)
DashboardWebApplication.cs (2)
625var endpoint = endpointConfiguration.ListenOptions.IPEndPoint!; 845public record EndpointInfo(BindingAddress BindingAddress, IPEndPoint EndPoint, bool IsHttps)
Aspire.Dashboard.Tests (7)
Integration\ServerRetryHelper.cs (5)
70var unavailableEndpoints = new List<IPEndPoint>(); 87var match = unavailableEndpoints.FirstOrDefault(ep => ep.Port == i); 101static void AddEndpoints(int startingPort, List<IPEndPoint> endpoints, IEnumerable<IPEndPoint> activeEndpoints) 103foreach (IPEndPoint endpoint in activeEndpoints)
Integration\StartupTests.cs (2)
719var ipEndPoint = endPointAccessor().EndPoint; 726var ipEndPoint = endPointAccessor().EndPoint;
Aspire.StackExchange.Redis (1)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\Implementation\RedisProfilerEntryToActivityConverter.cs (1)
141if (command.EndPoint is IPEndPoint ipEndPoint)
ClientSample (1)
Tcp\TcpHubConnectionBuilderExtensions.cs (1)
25IPEndPoint endPoint;
dotnet-svcutil-lib (7)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\Connection.cs (1)
503public IPEndPoint RemoteIPEndPoint
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\CoreClrSocketConnection.cs (5)
90protected override IPEndPoint RemoteEndPoint 99return (IPEndPoint)_socket.RemoteEndPoint; 565var remoteEndpoint = (IPEndPoint)_socket.RemoteEndPoint; 609IPEndPoint remote = RemoteEndPoint;
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\SocketConnection.cs (1)
74protected abstract IPEndPoint RemoteEndPoint { get; }
http2cat (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
66var endpoint = new IPEndPoint(ip, address.Port);
IIS.FunctionalTests (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
66var endpoint = new IPEndPoint(ip, address.Port);
IIS.LongTests (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
66var endpoint = new IPEndPoint(ip, address.Port);
IIS.NewHandler.FunctionalTests (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
66var endpoint = new IPEndPoint(ip, address.Port);
IIS.NewShim.FunctionalTests (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
66var endpoint = new IPEndPoint(ip, address.Port);
IISExpress.FunctionalTests (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
66var endpoint = new IPEndPoint(ip, address.Port);
InMemory.FunctionalTests (13)
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (5)
55var unavailableEndpoints = new List<IPEndPoint>(); 72var match = unavailableEndpoints.FirstOrDefault(ep => ep.Port == i); 86static void AddEndpoints(int startingPort, List<IPEndPoint> endpoints, IEnumerable<IPEndPoint> activeEndpoints) 88foreach (IPEndPoint endpoint in activeEndpoints)
src\Servers\Kestrel\shared\test\TestContextFactory.cs (8)
54IPEndPoint localEndPoint = null, 55IPEndPoint remoteEndPoint = null, 81IPEndPoint localEndPoint = null, 82IPEndPoint remoteEndPoint = null, 142IPEndPoint localEndPoint = null, 143IPEndPoint remoteEndPoint = null, 183IPEndPoint localEndPoint = null, 184IPEndPoint remoteEndPoint = null,
Interop.FunctionalTests (5)
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (5)
55var unavailableEndpoints = new List<IPEndPoint>(); 72var match = unavailableEndpoints.FirstOrDefault(ep => ep.Port == i); 86static void AddEndpoints(int startingPort, List<IPEndPoint> endpoints, IEnumerable<IPEndPoint> activeEndpoints) 88foreach (IPEndPoint endpoint in activeEndpoints)
Microsoft.AspNetCore.Components.WebAssembly.Server (2)
TargetPickerUi.cs (2)
117if (IPEndPoint.TryParse(_debugProxyUrl, out IPEndPoint? endpoint))
Microsoft.AspNetCore.Http.Extensions.Tests (2)
RequestDelegateFactoryTests.cs (2)
333new object[] { (Action<HttpContext, IPEndPoint[]>)Store, new[] { "127.0.0.1:80" },new[] { new IPEndPoint(IPAddress.Loopback, 80) } }, 384new object[] { (Action<HttpContext, IPEndPoint>)Store, "127.0.0.1:80", new IPEndPoint(IPAddress.Loopback, 80) },
Microsoft.AspNetCore.HttpOverrides (3)
ForwardedHeadersMiddleware.cs (3)
236if (IPEndPoint.TryParse(set.IpAndPortText, out var parsedEndPoint)) 415public IPEndPoint? RemoteIpAndPort;
Microsoft.AspNetCore.Mvc.Core.Test (1)
ModelBinding\Metadata\DefaultModelMetadataTest.cs (1)
348[InlineData(typeof(System.Net.IPEndPoint))]
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
66var endpoint = new IPEndPoint(ip, address.Port);
Microsoft.AspNetCore.Server.IntegrationTesting (2)
Common\TestPortHelper.cs (1)
27return ((IPEndPoint)socket.LocalEndPoint).Port;
Deployers\NginxDeployer.cs (1)
47builder.Port = ((IPEndPoint)_portSelector.LocalEndPoint).Port;
Microsoft.AspNetCore.Server.Kestrel.Core (38)
Internal\AddressBinder.cs (3)
71/// Returns an <see cref="IPEndPoint"/> for the given host an port. 74internal static bool TryCreateIPEndPoint(BindingAddress address, [NotNullWhen(true)] out IPEndPoint? endpoint) 133else if (TryCreateIPEndPoint(parsedAddress, out var endpoint))
Internal\BaseHttpConnectionContext.cs (4)
22IPEndPoint? localEndPoint, 23IPEndPoint? remoteEndPoint, 45public IPEndPoint? LocalEndPoint { get; } 46public IPEndPoint? RemoteEndPoint { get; }
Internal\Http\HttpProtocol.cs (4)
101private IPEndPoint? LocalEndPoint => _context.LocalEndPoint; 102private IPEndPoint? RemoteEndPoint => _context.RemoteEndPoint; 378var remoteEndPoint = RemoteEndPoint; 381var localEndPoint = LocalEndPoint;
Internal\Http2\Http2StreamContext.cs (2)
23IPEndPoint? localEndPoint, 24IPEndPoint? remoteEndPoint,
Internal\Http3\Http3Connection.cs (2)
669streamContext.LocalEndPoint as IPEndPoint, 670streamContext.RemoteEndPoint as IPEndPoint,
Internal\Http3\Http3StreamContext.cs (2)
23IPEndPoint? localEndPoint, 24IPEndPoint? remoteEndPoint,
Internal\HttpConnectionContext.cs (2)
23IPEndPoint? localEndPoint, 24IPEndPoint? remoteEndPoint,
Internal\HttpMultiplexedConnectionContext.cs (2)
22IPEndPoint? localEndPoint, 23IPEndPoint? remoteEndPoint,
Internal\Infrastructure\HttpUtilities.cs (1)
602public static AltSvcHeader? GetEndpointAltSvc(System.Net.IPEndPoint endpoint, HttpProtocols protocols)
Internal\Infrastructure\KestrelMetrics.cs (1)
325if (localEndpoint is IPEndPoint localIPEndPoint)
KestrelConfigurationLoader.cs (2)
109public KestrelConfigurationLoader Endpoint(IPEndPoint endPoint) => Endpoint(endPoint, _ => { }); 114public KestrelConfigurationLoader Endpoint(IPEndPoint endPoint, Action<ListenOptions> configure)
KestrelServerOptions.cs (2)
491public void Listen(IPEndPoint endPoint) 509public void Listen(IPEndPoint endPoint, Action<ListenOptions> configure)
ListenOptions.cs (5)
14/// Describes either an <see cref="System.Net.IPEndPoint"/>, Unix domain socket path, named pipe name, or a file descriptor for an already open 55/// Gets the bound <see cref="System.Net.IPEndPoint"/>. 58/// Only set if the <see cref="ListenOptions"/> is bound to a <see cref="System.Net.IPEndPoint"/>. 60public IPEndPoint? IPEndPoint => EndPoint as IPEndPoint;
Middleware\HttpConnectionMiddleware.cs (3)
33var localEndPoint = connectionContext.LocalEndPoint as IPEndPoint; 45connectionContext.RemoteEndPoint as IPEndPoint,
Middleware\HttpMultiplexedConnectionMiddleware.cs (3)
31var localEndPoint = connectionContext.LocalEndPoint as IPEndPoint; 44connectionContext.RemoteEndPoint as IPEndPoint,
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (37)
AddressBinderTests.cs (6)
29BindingAddress.Parse(address), out var endpoint)); 46BindingAddress.Parse(address), out var endpoint)); 58Assert.IsType<IPEndPoint>(listenOptions.EndPoint); 69Assert.IsType<IPEndPoint>(listenOptions.EndPoint); 81Assert.IsType<IPEndPoint>(listenOptions.EndPoint); 149Assert.IsType<IPEndPoint>(listenOptions.EndPoint);
KestrelServerTests.cs (18)
358var endpoint = new IPEndPoint(IPAddress.Loopback, 0); 399var endpoint = new IPEndPoint(IPAddress.Loopback, 0); 473Assert.Equal(IPAddress.IPv6Any, ((IPEndPoint)transportEndPoint.OriginalEndPoint).Address); 474Assert.Equal(IPAddress.IPv6Any, ((IPEndPoint)multiplexedTransportEndPoint.OriginalEndPoint).Address); 476Assert.Equal(5000, ((IPEndPoint)transportEndPoint.OriginalEndPoint).Port); 477Assert.Equal(5000, ((IPEndPoint)multiplexedTransportEndPoint.OriginalEndPoint).Port); 502Assert.Equal(IPAddress.IPv6Any, ((IPEndPoint)transportEndPoint.OriginalEndPoint).Address); 505Assert.NotEqual(0, ((IPEndPoint)transportEndPoint.BoundEndPoint).Port); 530Assert.Equal(IPAddress.IPv6Any, ((IPEndPoint)multiplexedTransportEndPoint.OriginalEndPoint).Address); 533Assert.NotEqual(0, ((IPEndPoint)multiplexedTransportEndPoint.BoundEndPoint).Port); 856if (((IPEndPoint)mockTransport.Object.EndPoint).Port == 5001) 887var port = ((IPEndPoint)mockTransport.Object.EndPoint).Port; 994if (resolvedEndPoint is IPEndPoint ipEndPoint) 997? Random.Shared.Next(IPEndPoint.MinPort, IPEndPoint.MaxPort) 1046if (resolvedEndPoint is IPEndPoint ipEndPoint) 1049? Random.Shared.Next(IPEndPoint.MinPort, IPEndPoint.MaxPort)
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (5)
55var unavailableEndpoints = new List<IPEndPoint>(); 72var match = unavailableEndpoints.FirstOrDefault(ep => ep.Port == i); 86static void AddEndpoints(int startingPort, List<IPEndPoint> endpoints, IEnumerable<IPEndPoint> activeEndpoints) 88foreach (IPEndPoint endpoint in activeEndpoints)
src\Servers\Kestrel\shared\test\TestContextFactory.cs (8)
54IPEndPoint localEndPoint = null, 55IPEndPoint remoteEndPoint = null, 81IPEndPoint localEndPoint = null, 82IPEndPoint remoteEndPoint = null, 142IPEndPoint localEndPoint = null, 143IPEndPoint remoteEndPoint = null, 183IPEndPoint localEndPoint = null, 184IPEndPoint remoteEndPoint = null,
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (8)
src\Servers\Kestrel\shared\test\TestContextFactory.cs (8)
54IPEndPoint localEndPoint = null, 55IPEndPoint remoteEndPoint = null, 81IPEndPoint localEndPoint = null, 82IPEndPoint remoteEndPoint = null, 142IPEndPoint localEndPoint = null, 143IPEndPoint remoteEndPoint = null, 183IPEndPoint localEndPoint = null, 184IPEndPoint remoteEndPoint = null,
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (4)
Internal\QuicConnectionListener.cs (2)
43if (endpoint is not IPEndPoint listenEndPoint) 45throw new InvalidOperationException($"QUIC doesn't support listening on the configured endpoint type. Expected {nameof(IPEndPoint)} but got {endpoint.GetType().Name}.");
Internal\QuicLog.cs (1)
208public static partial void ConnectionListenerStarting(ILogger logger, IPEndPoint listenEndPoint);
QuicTransportFactory.cs (1)
61return endpoint is IPEndPoint;
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (10)
QuicConnectionListenerTests.cs (3)
278var port = ((IPEndPoint)connectionListener.EndPoint).Port; 288var endpoint = new IPEndPoint(IPAddress.Loopback, 0); 293var port = ((IPEndPoint)socket.LocalEndPoint).Port;
QuicTestHelpers.cs (2)
59var endpoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), port); 73var endpoint = new IPEndPoint(IPAddress.Loopback, port);
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (5)
55var unavailableEndpoints = new List<IPEndPoint>(); 72var match = unavailableEndpoints.FirstOrDefault(ep => ep.Port == i); 86static void AddEndpoints(int startingPort, List<IPEndPoint> endpoints, IEnumerable<IPEndPoint> activeEndpoints) 88foreach (IPEndPoint endpoint in activeEndpoints)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (5)
Client\SocketConnectionFactory.cs (2)
49var ipEndPoint = endpoint as IPEndPoint;
SocketConnectionListener.cs (1)
70if (acceptSocket.LocalEndPoint is IPEndPoint)
SocketTransportFactory.cs (1)
49IPEndPoint _ => true,
SocketTransportOptions.cs (1)
142case IPEndPoint ip:
Microsoft.AspNetCore.SpaServices.Extensions (1)
Util\TcpPortFinder.cs (1)
17return ((IPEndPoint)listener.LocalEndpoint).Port;
Microsoft.Extensions.Diagnostics.Probes.Tests (1)
TcpEndpointProbesServiceTests.cs (1)
126int port = ((IPEndPoint)listener.LocalEndpoint).Port;
Microsoft.Extensions.ServiceDiscovery (1)
Http\ResolvingHttpDelegatingHandler.cs (1)
89case IPEndPoint ip:
Microsoft.Extensions.ServiceDiscovery.Abstractions (2)
Internal\ServiceEndpointImpl.cs (2)
17IPEndPoint ip when ip.Port == 0 && ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6 => $"[{ip.Address}]", 18IPEndPoint ip when ip.Port == 0 => $"{ip.Address}",
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (4)
DnsSrvServiceEndpointResolverTests.cs (4)
42public IDnsQueryResponse QueryServer(IReadOnlyCollection<IPEndPoint> servers, string query, QueryType queryType, QueryClass queryClass = QueryClass.IN) => throw new NotImplementedException(); 48public Task<IDnsQueryResponse> QueryServerAsync(IReadOnlyCollection<IPEndPoint> servers, string query, QueryType queryType, QueryClass queryClass = QueryClass.IN, CancellationToken cancellationToken = default) => throw new NotImplementedException(); 50public IDnsQueryResponse QueryServerReverse(IReadOnlyCollection<IPEndPoint> servers, IPAddress ipAddress) => throw new NotImplementedException(); 54public Task<IDnsQueryResponse> QueryServerReverseAsync(IReadOnlyCollection<IPEndPoint> servers, IPAddress ipAddress, CancellationToken cancellationToken = default) => throw new NotImplementedException();
Microsoft.Extensions.ServiceDiscovery.Tests (11)
ServiceEndpointResolverTests.cs (9)
115var ip = Assert.IsType<IPEndPoint>(sep.EndPoint); 128var endpoints = resolverResult.EndpointSource.Endpoints.Select(ep => ep.EndPoint).OfType<IPEndPoint>().ToList(); 164var ip = Assert.IsType<IPEndPoint>(sep.EndPoint); 201var ip = Assert.IsType<IPEndPoint>(endpoint.EndPoint); 285var ip = Assert.IsType<IPEndPoint>(sep.EndPoint);
ServiceEndpointTests.cs (2)
13IPEndPoint.Parse("127.0.0.1:0"), 20IPEndPoint.Parse("127.0.0.1:8443"),
Microsoft.Extensions.ServiceDiscovery.Yarp.Tests (4)
YarpServiceDiscoveryTests.cs (4)
336public IDnsQueryResponse QueryServer(IReadOnlyCollection<IPEndPoint> servers, string query, QueryType queryType, QueryClass queryClass = QueryClass.IN) => throw new NotImplementedException(); 342public Task<IDnsQueryResponse> QueryServerAsync(IReadOnlyCollection<IPEndPoint> servers, string query, QueryType queryType, QueryClass queryClass = QueryClass.IN, CancellationToken cancellationToken = default) => throw new NotImplementedException(); 344public IDnsQueryResponse QueryServerReverse(IReadOnlyCollection<IPEndPoint> servers, IPAddress ipAddress) => throw new NotImplementedException(); 348public Task<IDnsQueryResponse> QueryServerReverseAsync(IReadOnlyCollection<IPEndPoint> servers, IPAddress ipAddress, CancellationToken cancellationToken = default) => throw new NotImplementedException();
Microsoft.Gen.Logging.Generated.Tests (1)
test\Generators\Microsoft.Gen.Logging\TestClasses\LogPropertiesSpecialTypesExtensions.cs (1)
25public IPEndPoint? P8 { get; set; }
netstandard (1)
netstandard.cs (1)
1159[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Net.IPEndPoint))]
Sockets.BindTests (12)
src\Servers\Kestrel\test\BindTests\AddressRegistrationTests.cs (12)
106public async Task RegisterIPEndPoint_DynamicPort_Success(IPEndPoint endPoint, string testUrl) 114public async Task RegisterIPEndPoint_Port443_Success(IPEndPoint endpoint, string testUrl) 304private async Task RegisterIPEndPoint_Success(IPEndPoint endPoint, string testUrl, int testPort = 0) 542var port = ((IPEndPoint)socket.LocalEndPoint).Port; 577var port = ((IPEndPoint)socket.LocalEndPoint).Port; 945port = ((IPEndPoint)socket.LocalEndPoint).Port; 1040public static TheoryData<IPEndPoint, string> IPEndPointRegistrationDataDynamicPort 1044var dataset = new TheoryData<IPEndPoint, string>(); 1098public static TheoryData<IPEndPoint, string> IPEndPointRegistrationDataPort443 => 1099new TheoryData<IPEndPoint, string> 1203return ((IPEndPoint)socket.LocalEndPoint).Port; 1207private static bool CanBindAndConnectToEndpoint(IPEndPoint endPoint)
Sockets.FunctionalTests (3)
SocketTransportTests.cs (2)
40var ip = (IPEndPoint)socket.RemoteEndPoint;
src\Servers\Kestrel\test\FunctionalTests\ListenHandleTests.cs (1)
39using (var connection = new TestConnection(((IPEndPoint)_canListenToOpenTcpSocketHandleSocket.LocalEndPoint).Port))
System (1)
src\libraries\shims\System\ref\System.cs (1)
644[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Net.IPEndPoint))]
System.Net (1)
System.Net.cs (1)
20[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Net.IPEndPoint))]
System.Net.Http (18)
System\Net\Http\HttpTelemetry.cs (4)
103private void ConnectionEstablished(byte versionMajor, byte versionMinor, long connectionId, string scheme, string host, int port, IPEndPoint? remoteEndPoint) 207public void Http11ConnectionEstablished(long connectionId, string scheme, string host, int port, IPEndPoint? remoteEndPoint) 222public void Http20ConnectionEstablished(long connectionId, string scheme, string host, int port, IPEndPoint? remoteEndPoint) 237public void Http30ConnectionEstablished(long connectionId, string scheme, string host, int port, IPEndPoint? remoteEndPoint)
System\Net\Http\SocketsHttpHandler\ConnectionPool\ConnectionSetupDistributedTracing.cs (1)
40public static void StopConnectionSetupActivity(Activity activity, Exception? exception, IPEndPoint? remoteEndPoint)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (4)
568private async ValueTask<(Stream, TransportContext?, Activity?, IPEndPoint?)> ConnectAsync(HttpRequestMessage request, bool async, CancellationToken cancellationToken) 571IPEndPoint? remoteEndPoint = null; 657static IPEndPoint? GetRemoteEndPoint(Stream stream) => (stream as NetworkStream)?.Socket?.RemoteEndPoint as IPEndPoint;
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http1.cs (2)
296(Stream stream, TransportContext? transportContext, Activity? activity, IPEndPoint? remoteEndPoint) = await ConnectAsync(request, async, cancellationToken).ConfigureAwait(false); 300private async ValueTask<HttpConnection> ConstructHttp11ConnectionAsync(bool async, Stream stream, TransportContext? transportContext, HttpRequestMessage request, Activity? activity, IPEndPoint? remoteEndPoint, CancellationToken cancellationToken)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http2.cs (3)
187(Stream stream, TransportContext? transportContext, Activity? activity, IPEndPoint? remoteEndPoint) = await ConnectAsync(queueItem.Request, true, cts.Token).ConfigureAwait(false); 246private async ValueTask<Http2Connection> ConstructHttp2ConnectionAsync(Stream stream, HttpRequestMessage request, Activity? activity, IPEndPoint? remoteEndPoint, CancellationToken cancellationToken) 289private async Task HandleHttp11Downgrade(HttpRequestMessage request, Stream stream, TransportContext? transportContext, Activity? activity, IPEndPoint? remoteEndPoint, CancellationToken cancellationToken)
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (1)
133public Http2Connection(HttpConnectionPool pool, Stream stream, Activity? connectionSetupActivity, IPEndPoint? remoteEndPoint)
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (1)
77IPEndPoint? remoteEndPoint)
System\Net\Http\SocketsHttpHandler\HttpConnectionBase.cs (2)
50public HttpConnectionBase(HttpConnectionPool pool, Activity? connectionSetupActivity, IPEndPoint? remoteEndPoint) 56protected void MarkConnectionAsEstablished(Activity? connectionSetupActivity, IPEndPoint? remoteEndPoint)
System.Net.HttpListener (9)
System\Net\Managed\HttpConnection.cs (5)
65private IPEndPoint? _localEndPoint; 154public IPEndPoint? LocalEndPoint 161_localEndPoint = (IPEndPoint?)_socket!.LocalEndPoint; 166public IPEndPoint? RemoteEndPoint 168get { return (IPEndPoint?)_socket!.RemoteEndPoint; }
System\Net\Managed\HttpEndPointListener.cs (1)
43private readonly IPEndPoint _endpoint;
System\Net\Managed\HttpEndPointManager.cs (1)
169public static void RemoveEndPoint(HttpEndPointListener epl, IPEndPoint ep)
System\Net\Managed\HttpListenerRequest.Managed.cs (2)
338public IPEndPoint? LocalEndPoint => _context.Connection.LocalEndPoint; 340public IPEndPoint? RemoteEndPoint => _context.Connection.RemoteEndPoint;
System.Net.NetworkInformation (22)
System\Net\NetworkInformation\IPGlobalProperties.cs (2)
26public abstract IPEndPoint[] GetActiveUdpListeners(); 32public abstract IPEndPoint[] GetActiveTcpListeners();
System\Net\NetworkInformation\LinuxIPGlobalProperties.cs (2)
15public override IPEndPoint[] GetActiveTcpListeners() 21public override IPEndPoint[] GetActiveUdpListeners()
System\Net\NetworkInformation\SimpleTcpConnectionInformation.Unix.cs (4)
8public SimpleTcpConnectionInformation(IPEndPoint localEndPoint, IPEndPoint remoteEndPoint, TcpState state) 15public override IPEndPoint LocalEndPoint { get; } 17public override IPEndPoint RemoteEndPoint { get; }
System\Net\NetworkInformation\StringParsingHelpers.Connections.cs (12)
105internal static IPEndPoint[] ParseActiveTcpListenersFromFiles(string? tcp4ConnectionsFile, string? tcp6ConnectionsFile) 143IPEndPoint[] endPoints = new IPEndPoint[count]; 185public static IPEndPoint[] ParseActiveUdpListenersFromFiles(string? udp4File, string? udp6File) 222IPEndPoint[] endPoints = new IPEndPoint[count]; 229IPEndPoint endPoint = ParseLocalConnectionInformation(line); 237IPEndPoint endPoint = ParseLocalConnectionInformation(line); 251IPEndPoint localEndPoint = ParseAddressAndPort(localAddressAndPort); 254IPEndPoint remoteEndPoint = ParseAddressAndPort(remoteAddressAndPort); 269private static IPEndPoint ParseLocalConnectionInformation(string line) 293private static IPEndPoint ParseAddressAndPort(string colonSeparatedAddress)
System\Net\NetworkInformation\TcpConnection.cs (2)
14public abstract IPEndPoint LocalEndPoint { get; } 19public abstract IPEndPoint RemoteEndPoint { get; }
System.Net.Ping (6)
src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (3)
51public static IPEndPoint CreateIPEndPoint(ReadOnlySpan<byte> socketAddressBuffer) 57public static void Serialize(this IPEndPoint endPoint, Span<byte> destination) 64public static bool Equals(this IPEndPoint endPoint, ReadOnlySpan<byte> socketAddressBuffer)
System\Net\NetworkInformation\Ping.RawSocket.cs (3)
63IPEndPoint ep = (IPEndPoint)socketConfig.EndPoint; 245IPAddress address = ((IPEndPoint)socketConfig.EndPoint).Address;
System.Net.Primitives (17)
src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (3)
51public static IPEndPoint CreateIPEndPoint(ReadOnlySpan<byte> socketAddressBuffer) 57public static void Serialize(this IPEndPoint endPoint, Span<byte> destination) 64public static bool Equals(this IPEndPoint endPoint, ReadOnlySpan<byte> socketAddressBuffer)
src\libraries\Common\src\System\Net\SocketAddressExtensions.cs (2)
18public static IPEndPoint GetIPEndPoint(this SocketAddress socketAddress) 25if (socketAddress.Family == endPoint?.AddressFamily && endPoint is IPEndPoint ipe)
src\libraries\Common\src\System\Net\TcpValidationHelpers.cs (2)
12return port >= IPEndPoint.MinPort && port <= IPEndPoint.MaxPort;
System\Net\DnsEndPoint.cs (2)
21ArgumentOutOfRangeException.ThrowIfLessThan(port, IPEndPoint.MinPort); 22ArgumentOutOfRangeException.ThrowIfGreaterThan(port, IPEndPoint.MaxPort);
System\Net\IPEndPoint.cs (8)
16/// Specifies the minimum acceptable value for the <see cref='System.Net.IPEndPoint.Port'/> property. 21/// Specifies the maximum acceptable value for the <see cref='System.Net.IPEndPoint.Port'/> property. 90public static bool TryParse(string s, [NotNullWhen(true)] out IPEndPoint? result) 95public static bool TryParse(ReadOnlySpan<char> s, [NotNullWhen(true)] out IPEndPoint? result) 130public static IPEndPoint Parse(string s) 137public static IPEndPoint Parse(ReadOnlySpan<char> s) 139if (TryParse(s, out IPEndPoint? result)) 174return comparand is IPEndPoint other && other._address.Equals(_address) && other._port == _port;
System.Net.Quic (14)
src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (3)
51public static IPEndPoint CreateIPEndPoint(ReadOnlySpan<byte> socketAddressBuffer) 57public static void Serialize(this IPEndPoint endPoint, Span<byte> destination) 64public static bool Equals(this IPEndPoint endPoint, ReadOnlySpan<byte> socketAddressBuffer)
System\Net\Quic\Internal\MsQuicHelpers.cs (3)
24if (endPoint is IPEndPoint ipEndPoint) 38internal static unsafe IPEndPoint QuicAddrToIPEndPoint(QuicAddr* quicAddress, AddressFamily? addressFamilyOverride = null) 49internal static unsafe QuicAddr ToQuicAddr(this IPEndPoint ipEndPoint)
System\Net\Quic\QuicConnection.cs (4)
182private IPEndPoint _remoteEndPoint = null!; 186private IPEndPoint _localEndPoint = null!; 235public IPEndPoint RemoteEndPoint => _remoteEndPoint; 239public IPEndPoint LocalEndPoint => _localEndPoint;
System\Net\Quic\QuicConnectionOptions.cs (2)
189/// The remote endpoint to connect to. May be both <see cref="DnsEndPoint"/>, which will get resolved to an IP before connecting, or directly <see cref="IPEndPoint"/>. 197public IPEndPoint? LocalEndPoint { get; set; }
System\Net\Quic\QuicListener.cs (1)
110public IPEndPoint LocalEndPoint { get; }
System\Net\Quic\QuicListenerOptions.cs (1)
21public IPEndPoint ListenEndPoint { get; set; } = null!;
System.Net.Requests (14)
System\Net\FtpControlStream.cs (10)
33private IPEndPoint? _passiveEndPoint; 112if (!connection.ServerAddress.Equals(((IPEndPoint)connection._dataSocket.RemoteEndPoint!).Address)) 706IPEndPoint localEndPoint = new IPEndPoint(((IPEndPoint)Socket.LocalEndPoint!).Address, 0); 716IPEndPoint passiveEndPoint = _passiveEndPoint; 745if (!ServerAddress.Equals(((IPEndPoint)_dataSocket.RemoteEndPoint!).Address)) 1102IPEndPoint epListener = new IPEndPoint(((IPEndPoint)Socket.LocalEndPoint!).Address, 0); 1125IPEndPoint localEP = (IPEndPoint)_dataSocket!.LocalEndPoint!;
System\Net\HttpWebRequest.cs (1)
1796IPEndPoint? endPoint = servicePoint.BindIPEndPointDelegate(servicePoint, new IPEndPoint(address, port), retryCount);
System\Net\NetworkStreamWrapper.cs (1)
35return ((IPEndPoint)Socket.RemoteEndPoint!).Address;
System\Net\ServicePoint\BindIPEndPoint.cs (2)
6public delegate IPEndPoint BindIPEndPoint(ServicePoint servicePoint, IPEndPoint remoteEndPoint, int retryCount);
System.Net.Sockets (54)
src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (3)
51public static IPEndPoint CreateIPEndPoint(ReadOnlySpan<byte> socketAddressBuffer) 57public static void Serialize(this IPEndPoint endPoint, Span<byte> destination) 64public static bool Equals(this IPEndPoint endPoint, ReadOnlySpan<byte> socketAddressBuffer)
src\libraries\Common\src\System\Net\IPEndPointStatics.cs (3)
8internal const int AnyPort = IPEndPoint.MinPort; 9internal static readonly IPEndPoint Any = new IPEndPoint(IPAddress.Any, AnyPort); 10internal static readonly IPEndPoint IPv6Any = new IPEndPoint(IPAddress.IPv6Any, AnyPort);
src\libraries\Common\src\System\Net\SocketAddressExtensions.cs (2)
18public static IPEndPoint GetIPEndPoint(this SocketAddress socketAddress) 25if (socketAddress.Family == endPoint?.AddressFamily && endPoint is IPEndPoint ipe)
src\libraries\Common\src\System\Net\TcpValidationHelpers.cs (2)
12return port >= IPEndPoint.MinPort && port <= IPEndPoint.MaxPort;
System\Net\Sockets\Socket.cs (9)
26private static readonly IPEndPoint s_IPEndPointIPv6 = new IPEndPoint(s_IPAddressAnyMapToIPv6, 0); 804IPEndPoint? ipEndPoint = endPointSnapshot as IPEndPoint; 897IPEndPoint remoteEP = new IPEndPoint(address, port); 3266if (e._socketAddress != null && endPointSnapshot is IPEndPoint ipep && e._socketAddress.Family == endPointSnapshot?.AddressFamily) 3334if (remoteEP is IPEndPoint ip) 3569IPEndPoint? ipEndPoint = _rightEndPoint as IPEndPoint; 3872if (endPoint is IPEndPoint ipEndpoint)
System\Net\Sockets\Socket.Tasks.cs (1)
194IPEndPoint? endPoint = null;
System\Net\Sockets\SocketAsyncEventArgs.cs (1)
764if (internalArgs.RemoteEndPoint is IPEndPoint existing)
System\Net\Sockets\SocketsTelemetry.cs (1)
107if (endPoint is IPEndPoint ipEndPoint)
System\Net\Sockets\TCPClient.cs (7)
45public TcpClient(IPEndPoint localEP) 155IPEndPoint remoteEP = new IPEndPoint(address, port); 160public void Connect(IPEndPoint remoteEP) 196/// <param name="remoteEP">The <see cref="IPEndPoint"/> to which you intend to connect.</param> 198public Task ConnectAsync(IPEndPoint remoteEP) => 219/// <param name="remoteEP">The <see cref="IPEndPoint"/> to which you intend to connect.</param> 222public ValueTask ConnectAsync(IPEndPoint remoteEP, CancellationToken cancellationToken) =>
System\Net\Sockets\TCPListener.cs (2)
16private readonly IPEndPoint _serverSocketEP; 23public TcpListener(IPEndPoint localEP)
System\Net\Sockets\UDPClient.cs (20)
64IPEndPoint localEP; 83public UdpClient(IPEndPoint localEP) 285public IAsyncResult BeginSend(byte[] datagram, int bytes, IPEndPoint? endPoint, AsyncCallback? requestCallback, object? state) 313private void ValidateDatagram(byte[] datagram, int bytes, IPEndPoint? endPoint) 329private IPEndPoint? GetEndpoint(string? hostname, int port) 337IPEndPoint? ipEndPoint = null; 375public byte[] EndReceive(IAsyncResult asyncResult, ref IPEndPoint? remoteEP) 386remoteEP = (IPEndPoint)tempRemoteEP; 567public Task<int> SendAsync(byte[] datagram, int bytes, IPEndPoint? endPoint) 589/// An <see cref="IPEndPoint"/> that represents the host and port to which to send the datagram. 598public ValueTask<int> SendAsync(ReadOnlyMemory<byte> datagram, IPEndPoint? endPoint, CancellationToken cancellationToken = default) 628return new UdpReceiveResult(buffer, (IPEndPoint)result.RemoteEndPoint); 654return new UdpReceiveResult(buffer, (IPEndPoint)result.RemoteEndPoint); 813IPEndPoint endPoint = new IPEndPoint(addr, port); 818public void Connect(IPEndPoint endPoint) 831public byte[] Receive([NotNull] ref IPEndPoint? remoteEP) 845remoteEP = (IPEndPoint)tempRemoteEP; 854public int Send(byte[] dgram, int bytes, IPEndPoint? endPoint) 884/// An <see cref="IPEndPoint"/> that represents the host and port to which to send the datagram. 890public int Send(ReadOnlySpan<byte> datagram, IPEndPoint? endPoint)
System\Net\Sockets\UdpReceiveResult.cs (3)
14private readonly IPEndPoint _remoteEndPoint; 21public UdpReceiveResult(byte[] buffer, IPEndPoint remoteEndPoint) 44public IPEndPoint RemoteEndPoint