Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Net.​IPEndPoint

Assembly: System.Net.Primitives

Inheritance: object → EndPoint → IPEndPoint

Represents a network endpoint as an IP address and a port number.

Fields and Constants

public const int
MaxPort
Specifies the maximum value that can be assigned to the <see cref="P:System.Net.IPEndPoint.Port" /> property. The MaxPort value is set to 0x0000FFFF. This field is read-only.
public const int
MinPort
Specifies the minimum value that can be assigned to the <see cref="P:System.Net.IPEndPoint.Port" /> property. This field is read-only.

Properties

public IPAddress
Address
Gets or sets the IP address of the endpoint.
public AddressFamily
AddressFamily
Gets the Internet Protocol (IP) address family.
public int
Port
Gets or sets the port number of the endpoint.

Methods

public EndPoint
Create​(SocketAddress socketAddress)
Creates an endpoint from a socket address.
Returns An <see cref="T:System.Net.EndPoint" /> instance using the specified socket address.
socketAddress The <see cref="T:System.Net.SocketAddress" /> to use for the endpoint.
public bool
Equals​(object comparand)
Determines whether the specified <see cref="T:System.Object" /> is equal to the current <see cref="T:System.Object" /> .
Returns <see langword="true" /> if the specified <see cref="T:System.Object" /> is equal to the current <see cref="T:System.Object" /> ; otherwise, <see langword="false" /> .
comparand The <see cref="T:System.Object" /> to compare with the current <see cref="T:System.Object" /> .
public int
GetHashCode​()
Returns a hash value for a <see cref="T:System.Net.IPEndPoint" /> instance.
Returns An integer hash value.
public static IPEndPoint
Parse​(ReadOnlySpan<​char> s)
Converts an IP network endpoint (address and port) represented as a read-only span to an <see cref="T:System.Net.IPEndPoint" /> instance.
Returns The object representation of an IP network endpoint.
s A read-only span that contains an IP endpoint in dotted-quad notation or network byte order for IPv4 and in colon-hexadecimal notation for IPv6.
public static IPEndPoint
Parse​(string s)
Converts an IP network endpoint (address and port) represented as a string to an <see cref="T:System.Net.IPEndPoint" /> instance.
Returns The object representation of an IP network endpoint.
s A string that contains an IP endpoint in dotted-quad notation or network byte order for IPv4 and in colon-hexadecimal notation for IPv6.
public SocketAddress
Serialize​()
Serializes endpoint information into a <see cref="T:System.Net.SocketAddress" /> instance.
Returns A <see cref="T:System.Net.SocketAddress" /> instance containing the socket address for the endpoint.
public string
ToString​()
Returns the IP address and port number of the specified endpoint.
Returns A string containing the IP address and the port number of the specified endpoint (for example, 192.168.1.2:80).
public static bool
TryParse​(ReadOnlySpan<​char> s, IPEndPoint&? result)
public static bool
TryParse​(string s, IPEndPoint&? result)
protected void
Finalize​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object