212 instantiations of IPEndPoint
ClientSample (2)
dotnet-svcutil-lib (2)
http2cat (1)
HttpsPolicySample (2)
IIS.Common.TestLib (1)
IIS.FunctionalTests (2)
IIS.LongTests (2)
IIS.NewHandler.FunctionalTests (2)
IIS.NewShim.FunctionalTests (2)
IISExpress.FunctionalTests (3)
InMemory.FunctionalTests (32)
Microsoft.AspNetCore.Http.Abstractions (2)
Microsoft.AspNetCore.HttpOverrides (2)
Microsoft.AspNetCore.HttpOverrides.Tests (1)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
Microsoft.AspNetCore.Server.IntegrationTesting (3)
Microsoft.AspNetCore.Server.Kestrel.Core (7)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (29)
KestrelServerTests.cs (25)
107serverOptions.Listen(new IPEndPoint(IPAddress.Loopback, 0));
344serverOptions.Listen(new IPEndPoint(IPAddress.Loopback, 0));
360var endpoint = new IPEndPoint(IPAddress.Loopback, 0);
381serverOptions.Listen(new IPEndPoint(IPAddress.Loopback, 0), c =>
401var endpoint = new IPEndPoint(IPAddress.Loopback, 0);
545new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0))
602new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0))
662new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0))
724new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0))
828mockTransportFactory.Verify(f => f.BindAsync(new IPEndPoint(IPAddress.IPv6Any, 5000), It.IsAny<CancellationToken>()), Times.Once);
829mockTransportFactory.Verify(f => f.BindAsync(new IPEndPoint(IPAddress.IPv6Any, 5001), It.IsAny<CancellationToken>()), Times.Once);
830mockTransportFactory.Verify(f => f.BindAsync(new IPEndPoint(IPAddress.IPv6Any, 5002), It.IsAny<CancellationToken>()), Times.Never);
831mockTransportFactory.Verify(f => f.BindAsync(new IPEndPoint(IPAddress.IPv6Any, 5003), It.IsAny<CancellationToken>()), Times.Never);
849mockTransportFactory.Verify(f => f.BindAsync(new IPEndPoint(IPAddress.IPv6Any, 5000), It.IsAny<CancellationToken>()), Times.Once);
850mockTransportFactory.Verify(f => f.BindAsync(new IPEndPoint(IPAddress.IPv6Any, 5001), It.IsAny<CancellationToken>()), Times.Once);
851mockTransportFactory.Verify(f => f.BindAsync(new IPEndPoint(IPAddress.IPv6Any, 5002), It.IsAny<CancellationToken>()), Times.Once);
852mockTransportFactory.Verify(f => f.BindAsync(new IPEndPoint(IPAddress.IPv6Any, 5003), It.IsAny<CancellationToken>()), Times.Once);
878mockTransportFactory.Verify(f => f.BindAsync(new IPEndPoint(IPAddress.IPv6Any, 5000), It.IsAny<CancellationToken>()), Times.Once);
879mockTransportFactory.Verify(f => f.BindAsync(new IPEndPoint(IPAddress.IPv6Any, 5001), It.IsAny<CancellationToken>()), Times.Once);
880mockTransportFactory.Verify(f => f.BindAsync(new IPEndPoint(IPAddress.IPv6Any, 5002), It.IsAny<CancellationToken>()), Times.Once);
881mockTransportFactory.Verify(f => f.BindAsync(new IPEndPoint(IPAddress.IPv6Any, 5003), It.IsAny<CancellationToken>()), Times.Exactly(2));
966mockTransportFactory.Verify(f => f.BindAsync(new IPEndPoint(IPAddress.IPv6Any, 5000), It.IsAny<CancellationToken>()), Times.Once);
967mockTransportFactory.Verify(f => f.BindAsync(new IPEndPoint(IPAddress.IPv6Any, 5001), It.IsAny<CancellationToken>()), Times.Once);
1002resolvedEndPoint = new IPEndPoint(new IPAddress(ipEndPoint.Address.GetAddressBytes()), port);
1054resolvedEndPoint = new IPEndPoint(new IPAddress(ipEndPoint.Address.GetAddressBytes()), port);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (6)
Microsoft.AspNetCore.SignalR.Client.Tests (1)
Microsoft.AspNetCore.Testing (2)
Microsoft.Extensions.Diagnostics.Probes.Tests (1)
Microsoft.Gen.Logging.Generated.Tests (2)
Sockets.BindTests (39)
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)
System.Net.HttpListener (1)
System.Net.NetworkInformation (2)
System.Net.Ping (2)
System.Net.Primitives (4)
System.Net.Quic (2)
System.Net.Requests (4)
System.Net.Sockets (29)
System.ServiceModel.NetTcp (1)
TlsFeaturesObserve (1)
385 references to IPEndPoint
Aspire.Dashboard (2)
Aspire.Dashboard.Tests (8)
Aspire.StackExchange.Redis (1)
ClientSample (1)
dotnet-svcutil-lib (7)
http2cat (1)
IIS.FunctionalTests (1)
IIS.LongTests (1)
IIS.NewHandler.FunctionalTests (1)
IIS.NewShim.FunctionalTests (1)
IISExpress.FunctionalTests (1)
InMemory.FunctionalTests (13)
Interop.FunctionalTests (5)
Microsoft.AspNetCore.Components.WebAssembly.Server (2)
Microsoft.AspNetCore.HttpOverrides (3)
Microsoft.AspNetCore.Mvc.Core.Test (1)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
Microsoft.AspNetCore.Server.IntegrationTesting (2)
Microsoft.AspNetCore.Server.Kestrel.Core (38)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (38)
KestrelServerTests.cs (18)
360var endpoint = new IPEndPoint(IPAddress.Loopback, 0);
401var endpoint = new IPEndPoint(IPAddress.Loopback, 0);
475Assert.Equal(IPAddress.IPv6Any, ((IPEndPoint)transportEndPoint.OriginalEndPoint).Address);
476Assert.Equal(IPAddress.IPv6Any, ((IPEndPoint)multiplexedTransportEndPoint.OriginalEndPoint).Address);
478Assert.Equal(5000, ((IPEndPoint)transportEndPoint.OriginalEndPoint).Port);
479Assert.Equal(5000, ((IPEndPoint)multiplexedTransportEndPoint.OriginalEndPoint).Port);
504Assert.Equal(IPAddress.IPv6Any, ((IPEndPoint)transportEndPoint.OriginalEndPoint).Address);
507Assert.NotEqual(0, ((IPEndPoint)transportEndPoint.BoundEndPoint).Port);
532Assert.Equal(IPAddress.IPv6Any, ((IPEndPoint)multiplexedTransportEndPoint.OriginalEndPoint).Address);
535Assert.NotEqual(0, ((IPEndPoint)multiplexedTransportEndPoint.BoundEndPoint).Port);
858if (((IPEndPoint)mockTransport.Object.EndPoint).Port == 5001)
889var port = ((IPEndPoint)mockTransport.Object.EndPoint).Port;
996if (resolvedEndPoint is IPEndPoint ipEndPoint)
999? Random.Shared.Next(IPEndPoint.MinPort, IPEndPoint.MaxPort)
1048if (resolvedEndPoint is IPEndPoint ipEndPoint)
1051? Random.Shared.Next(IPEndPoint.MinPort, IPEndPoint.MaxPort)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (8)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (4)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (10)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (5)
Microsoft.AspNetCore.SpaServices.Extensions (1)
Microsoft.Extensions.Diagnostics.Probes.Tests (1)
Microsoft.Gen.Logging.Generated.Tests (1)
netstandard (1)
Sockets.BindTests (12)
Sockets.FunctionalTests (3)
System (1)
System.Net (1)
System.Net.Http (18)
System\Net\Http\HttpTelemetry.cs (4)
105private void ConnectionEstablished(byte versionMajor, byte versionMinor, long connectionId, string scheme, string host, int port, IPEndPoint? remoteEndPoint)
200public void Http11ConnectionEstablished(long connectionId, string scheme, string host, int port, IPEndPoint? remoteEndPoint)
215public void Http20ConnectionEstablished(long connectionId, string scheme, string host, int port, IPEndPoint? remoteEndPoint)
230public void Http30ConnectionEstablished(long connectionId, string scheme, string host, int port, IPEndPoint? remoteEndPoint)
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.HttpListener (9)
System.Net.NetworkInformation (22)
System.Net.Ping (6)
System.Net.Primitives (62)
System\Net\IPEndPoint.cs (53)
17public class IPEndPoint : EndPoint, ISpanFormattable, ISpanParsable<IPEndPoint>, IUtf8SpanFormattable, IUtf8SpanParsable<IPEndPoint>
20/// Specifies the minimum acceptable value for the <see cref='System.Net.IPEndPoint.Port'/> property.
25/// Specifies the maximum acceptable value for the <see cref='System.Net.IPEndPoint.Port'/> property.
94public static bool TryParse(string s, [NotNullWhen(true)] out IPEndPoint? result)
99internal static bool InternalTryParse<TChar>(ReadOnlySpan<TChar> s, [NotNullWhen(true)] out IPEndPoint? result)
156/// <summary>Tries to convert the character span to its <see cref="IPEndPoint"/> equivalent.</summary>
157/// <param name="s">A span container the characters representing the <see cref="IPEndPoint"/> to convert.</param>
158/// <param name="result">When this method returns, contains the <see cref="IPEndPoint"/> value equivalent to what is contained in <paramref name="s" /> if the conversion succeeded, or default if the conversion failed. This parameter is passed uninitialized; any value originally supplied in result will be overwritten.</param>
160public static bool TryParse(ReadOnlySpan<char> s, [NotNullWhen(true)] out IPEndPoint? result) => InternalTryParse(s, out result);
162public static IPEndPoint Parse(string s)
169public static IPEndPoint Parse(ReadOnlySpan<char> s)
171if (TryParse(s, out IPEndPoint? result))
206return comparand is IPEndPoint other && other._address.Equals(_address) && other._port == _port;
214/// <summary>Converts the UTF-8 span to its <see cref="IPEndPoint"/> equivalent.</summary>
215/// <param name="utf8Text">A span containing the characters representing the <see cref="IPEndPoint"/> to convert.</param>
216/// <returns>contains the <see cref="IPEndPoint"/> value equivalent to what is contained in <paramref name="utf8Text" /> if the conversion succeeded</returns>
218public static IPEndPoint Parse(ReadOnlySpan<byte> utf8Text)
220if (TryParse(utf8Text, out IPEndPoint? result))
228/// <summary>Converts the character span to its <see cref="IPEndPoint"/> equivalent.</summary>
229/// <param name="s">A span containing the characters representing the <see cref="IPEndPoint"/> to convert.</param>
231/// <returns>contains the <see cref="IPEndPoint"/> value equivalent to what is contained in <paramref name="s" /> if the conversion succeeded</returns>
233static IPEndPoint ISpanParsable<IPEndPoint>.Parse(ReadOnlySpan<char> s, IFormatProvider? provider) => Parse(s);
235/// <summary>Converts the string to its <see cref="IPEndPoint"/> equivalent.</summary>
236/// <param name="s">A string containing the characters representing the <see cref="IPEndPoint"/> to convert.</param>
238/// <returns>contains the <see cref="IPEndPoint"/> value equivalent to what is contained in <paramref name="s" /> if the conversion succeeded</returns>
240static IPEndPoint IParsable<IPEndPoint>.Parse(string s, IFormatProvider? provider) => Parse(s);
242/// <summary>Converts the UTF-8 span to its <see cref="IPEndPoint"/> equivalent.</summary>
243/// <param name="utf8Text">A Span containing the UTF-8 characters representing the <see cref="IPEndPoint"/> to convert.</param>
245/// <returns>contains the <see cref="IPEndPoint"/> value equivalent to what is contained in <paramref name="utf8Text" /> if the conversion succeeded</returns>
247static IPEndPoint IUtf8SpanParsable<IPEndPoint>.Parse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider) => Parse(utf8Text);
249/// <summary>Tries to convert the UTF-8 span to its <see cref="IPEndPoint"/> equivalent.</summary>
250/// <param name="utf8Text">A span containing the UTF-8 characters representing the <see cref="IPEndPoint"/> to convert.</param>
251/// <param name="result">When this method returns, contains the <see cref="IPEndPoint"/> value equivalent to what is contained in <paramref name="utf8Text" /> if the conversion succeeded, or default if the conversion failed. This parameter is passed uninitialized; any value originally supplied in result will be overwritten.</param>
253public static bool TryParse(ReadOnlySpan<byte> utf8Text, [NotNullWhen(true)] out IPEndPoint? result) => InternalTryParse(utf8Text, out result);
255/// <summary>Tries to convert the character span to its <see cref="IPEndPoint"/> equivalent.</summary>
256/// <param name="s">A span container the characters representing the <see cref="IPEndPoint"/> to convert.</param>
258/// <param name="result">When this method returns, contains the <see cref="IPEndPoint"/> value equivalent to what is contained in <paramref name="s" /> if the conversion succeeded, or default if the conversion failed. This parameter is passed uninitialized; any value originally supplied in result will be overwritten.</param>
260static bool ISpanParsable<IPEndPoint>.TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, [NotNullWhen(true)] out IPEndPoint? result) => TryParse(s, out result);
262/// <summary>Tries to convert the string to its <see cref="IPEndPoint"/> equivalent.</summary>
263/// <param name="s">A string representing the <see cref="IPEndPoint"/> to convert.</param>
265/// <param name="result">When this method returns, contains the <see cref="IPEndPoint"/> value equivalent to what is contained in <paramref name="s" /> if the conversion succeeded, or default if the conversion failed. This parameter is passed uninitialized; any value originally supplied in result will be overwritten.</param>
267static bool IParsable<IPEndPoint>.TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, [NotNullWhen(true)] out IPEndPoint? result)
278/// <summary>Tries to convert the UTF-8 span to its <see cref="IPEndPoint"/> equivalent.</summary>
279/// <param name="utf8Text">A span container the characters representing the <see cref="IPEndPoint"/> to convert.</param>
281/// <param name="result">When this method returns, contains the <see cref="IPEndPoint"/> value equivalent to what is contained in <paramref name="utf8Text" /> if the conversion succeeded, or default if the conversion failed. This parameter is passed uninitialized; any value originally supplied in result will be overwritten.</param>
283static bool IUtf8SpanParsable<IPEndPoint>.TryParse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider, [NotNullWhen(true)] out IPEndPoint? result) => TryParse(utf8Text, out result);
System.Net.Quic (14)
System.Net.Requests (14)
System.Net.Sockets (54)
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.ServiceModel.NetTcp (7)
TlsFeaturesObserve (3)