102 references to Port
Aspire.Dashboard (2)
DashboardWebApplication.cs (2)
851return BindingAddress.Scheme.ToLowerInvariant() + Uri.SchemeDelimiter + BindingAddress.Host.ToLowerInvariant() + ":" + EndPoint.Port.ToString(CultureInfo.InvariantCulture); 858return BindingAddress.Scheme.ToLowerInvariant() + Uri.SchemeDelimiter + "localhost:" + EndPoint.Port.ToString(CultureInfo.InvariantCulture);
Aspire.Dashboard.Tests (7)
Integration\ServerRetryHelper.cs (2)
87var match = unavailableEndpoints.FirstOrDefault(ep => ep.Port == i); 105if (endpoint.Port >= startingPort)
Integration\StartupTests.cs (5)
285Assert.Equal(app.FrontendSingleEndPointAccessor().EndPoint.Port, app.OtlpServiceGrpcEndPointAccessor().EndPoint.Port); 392Assert.Equal(app.FrontendSingleEndPointAccessor().EndPoint.Port, app.OtlpServiceGrpcEndPointAccessor().EndPoint.Port); 727Assert.NotEqual(0, ipEndPoint.Port);
Aspire.StackExchange.Redis (1)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\Implementation\RedisProfilerEntryToActivityConverter.cs (1)
144activity.SetTag(SemanticConventions.AttributeNetPeerPort, ipEndPoint.Port);
dotnet-svcutil-lib (2)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\CoreClrSocketConnection.cs (2)
566string remoteEndpointAddressString = remoteEndpoint.Address + ":" + remoteEndpoint.Port; 613remoteEndpointAddressString = remote.Address + ":" + remote.Port;
InMemory.FunctionalTests (2)
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (2)
72var match = unavailableEndpoints.FirstOrDefault(ep => ep.Port == i); 90if (endpoint.Port >= startingPort)
Interop.FunctionalTests (2)
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (2)
72var match = unavailableEndpoints.FirstOrDefault(ep => ep.Port == i); 90if (endpoint.Port >= startingPort)
Microsoft.AspNetCore.HttpOverrides (1)
ForwardedHeadersMiddleware.cs (1)
324connection.RemotePort = currentValues.RemoteIpAndPort.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 (10)
AnyIPListenOptions.cs (4)
33context.Logger.LogTrace(ex, CoreStrings.FailedToBindToIPv6Any, IPEndPoint.Port); 37context.Logger.LogDebug(CoreStrings.FallbackToIPv4Any, IPEndPoint.Port, IPEndPoint.Port); 41EndPoint = new IPEndPoint(IPAddress.Any, IPEndPoint.Port);
Internal\Http\HttpProtocol.cs (2)
380RemotePort = remoteEndPoint?.Port ?? 0; 383LocalPort = localEndPoint?.Port ?? 0;
Internal\Infrastructure\HttpUtilities.cs (1)
613var text = "h3=\":" + endpoint.Port.ToString(CultureInfo.InvariantCulture) + "\"; ma=86400";
Internal\Infrastructure\KestrelMetrics.cs (1)
328tags.Add("server.port", localIPEndPoint.Port);
ListenOptions.cs (1)
236var options = new ListenOptions(new IPEndPoint(address, IPEndPoint!.Port))
LocalhostListenOptions.cs (1)
26return $"{Scheme}://localhost:{IPEndPoint!.Port}";
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (18)
AddressBinderTests.cs (6)
32Assert.Equal(expectedPort, endpoint.Port); 60Assert.Equal(80, listenOptions.IPEndPoint.Port); 71Assert.Equal(80, listenOptions.IPEndPoint.Port); 82Assert.Equal(8080, listenOptions.IPEndPoint.Port); 151Assert.Equal(port, listenOptions.IPEndPoint.Port); 314Assert.Contains(endpoints, e => e.IPEndPoint.Port == 5000 && !e.IsTls);
KestrelServerTests.cs (10)
476Assert.Equal(5000, ((IPEndPoint)transportEndPoint.OriginalEndPoint).Port); 477Assert.Equal(5000, ((IPEndPoint)multiplexedTransportEndPoint.OriginalEndPoint).Port); 505Assert.NotEqual(0, ((IPEndPoint)transportEndPoint.BoundEndPoint).Port); 533Assert.NotEqual(0, ((IPEndPoint)multiplexedTransportEndPoint.BoundEndPoint).Port); 856if (((IPEndPoint)mockTransport.Object.EndPoint).Port == 5001) 887var port = ((IPEndPoint)mockTransport.Object.EndPoint).Port; 996var port = ipEndPoint.Port == 0 998: ipEndPoint.Port; 1048var port = ipEndPoint.Port == 0 1050: ipEndPoint.Port;
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (2)
72var match = unavailableEndpoints.FirstOrDefault(ep => ep.Port == i); 90if (endpoint.Port >= startingPort)
Microsoft.AspNetCore.Server.Kestrel.Tests (14)
KestrelConfigurationLoaderTests.cs (14)
72Assert.Equal(5001, serverOptions.ConfigurationBackedListenOptions[0].IPEndPoint.Port); 90Assert.Equal(5001, serverOptions.CodeBackedListenOptions[0].IPEndPoint.Port); 108Assert.Equal(5001, serverOptions.CodeBackedListenOptions[0].IPEndPoint.Port); 114Assert.Equal(5001, serverOptions.CodeBackedListenOptions[0].IPEndPoint.Port); 144Assert.Equal(5002, serverOptions.ConfigurationBackedListenOptions[0].IPEndPoint.Port); 145Assert.Equal(5003, serverOptions.CodeBackedListenOptions[0].IPEndPoint.Port); 1477Assert.Equal(5000, serverOptions.ConfigurationBackedListenOptions[0].IPEndPoint.Port); 1478Assert.Equal(5001, serverOptions.ConfigurationBackedListenOptions[1].IPEndPoint.Port); 1490Assert.Equal(5001, endpointsToStop[0].IPEndPoint.Port); 1493Assert.Equal(5002, endpointsToStart[0].IPEndPoint.Port); 1494Assert.Equal(5003, endpointsToStart[1].IPEndPoint.Port); 1497Assert.Equal(5000, serverOptions.ConfigurationBackedListenOptions[0].IPEndPoint.Port); 1530Assert.Equal(5000, stopEndpoint.IPEndPoint.Port); 1533Assert.Equal(5000, startEndpoint.IPEndPoint.Port);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (4)
QuicConnectionListenerTests.cs (2)
278var port = ((IPEndPoint)connectionListener.EndPoint).Port; 293var port = ((IPEndPoint)socket.LocalEndPoint).Port;
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (2)
72var match = unavailableEndpoints.FirstOrDefault(ep => ep.Port == i); 90if (endpoint.Port >= startingPort)
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)
91port = ip.Port;
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.Tests (4)
ServiceEndpointResolverTests.cs (4)
117Assert.Equal(8080, ip.Port); 166Assert.Equal(8080, ip.Port); 203Assert.Equal(8080, ip.Port); 287Assert.Equal(8080, ip.Port);
Sockets.BindTests (5)
src\Servers\Kestrel\shared\test\TransportTestHelpers\TestServer.cs (1)
125public int Port => _listenOptions.IPEndPoint?.Port ?? 0;
src\Servers\Kestrel\test\BindTests\AddressRegistrationTests.cs (4)
542var port = ((IPEndPoint)socket.LocalEndPoint).Port; 577var port = ((IPEndPoint)socket.LocalEndPoint).Port; 945port = ((IPEndPoint)socket.LocalEndPoint).Port; 1203return ((IPEndPoint)socket.LocalEndPoint).Port;
Sockets.FunctionalTests (3)
SocketTransportTests.cs (1)
42Assert.Equal(ip.Port, context.Connection.RemotePort);
src\Servers\Kestrel\shared\test\TransportTestHelpers\TestServer.cs (1)
125public int Port => _listenOptions.IPEndPoint?.Port ?? 0;
src\Servers\Kestrel\test\FunctionalTests\ListenHandleTests.cs (1)
39using (var connection = new TestConnection(((IPEndPoint)_canListenToOpenTcpSocketHandleSocket.LocalEndPoint).Port))
System.Net.HttpListener (2)
System\Net\Managed\HttpEndPointManager.cs (1)
175p.Remove(ep.Port);
System\Net\Managed\HttpListenerRequest.Managed.cs (1)
168string base_uri = $"{RequestScheme}://{host}:{LocalEndPoint!.Port}";
System.Net.Ping (2)
src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (2)
61SocketAddressPal.SetPort(destination, (ushort)endPoint.Port); 68endPoint.Port == (int)SocketAddressPal.GetPort(socketAddressBuffer))
System.Net.Primitives (5)
src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (2)
61SocketAddressPal.SetPort(destination, (ushort)endPoint.Port); 68endPoint.Port == (int)SocketAddressPal.GetPort(socketAddressBuffer))
System\Net\IPEndPoint.cs (3)
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. 152public override SocketAddress Serialize() => new SocketAddress(Address, Port);
System.Net.Quic (3)
src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (2)
61SocketAddressPal.SetPort(destination, (ushort)endPoint.Port); 68endPoint.Port == (int)SocketAddressPal.GetPort(socketAddressBuffer))
System\Net\Quic\Internal\MsQuicHelpers.cs (1)
28port = ipEndPoint.Port;
System.Net.Requests (2)
System\Net\FtpControlStream.cs (2)
1128return FormatAddress(localEP.Address, localEP.Port); 1132return FormatAddressV6(localEP.Address, localEP.Port);
System.Net.Sockets (6)
src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (2)
61SocketAddressPal.SetPort(destination, (ushort)endPoint.Port); 68endPoint.Port == (int)SocketAddressPal.GetPort(socketAddressBuffer))
System\Net\Sockets\Socket.cs (1)
3340remoteEP = new IPEndPoint(addr, ip.Port);
System\Net\Sockets\Socket.Tasks.cs (1)
206Debug.Assert(endPoint.Port == port);
System\Net\Sockets\SocketAsyncEventArgs.cs (1)
767Debug.Assert(existing.Port == port);
System\Net\Sockets\SocketsTelemetry.cs (1)
109int port = ipEndPoint.Port;