Skip to main content

IPEndPoint Class

NuGet: GHIElectronics.TinyCLR.Networking
Assembly: GHIElectronics.TinyCLR.Networking
Namespace: System.Net

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

public class IPEndPoint : EndPoint

Constructors

IPEndPoint(long address, int port)

public IPEndPoint(long address, int port)

Initializes a new instance with the specified address and port.

IPEndPoint(IPAddress address, int port)

public IPEndPoint(IPAddress address, int port)

Initializes a new instance with the specified address and port.

Properties

AddressFamily

public override AddressFamily AddressFamily { get; }

The address family to which the endpoint belongs. (inherited)

Address

public IPAddress Address { get; set; }

The IP address of the endpoint.

Port

public int Port { get; set; }

The port number of the endpoint.

Methods

Serialize()

public override SocketAddress Serialize()

Serializes endpoint information into a SocketAddress instance. (inherited)

Returns SocketAddress

Create(SocketAddress socketAddress)

public override EndPoint Create(SocketAddress socketAddress)

Creates an endpoint from a socket address. (inherited)

Returns EndPoint

ToString()

public override string ToString()

Returns the endpoint as an "address:port" string.

Returns string

Equals(object obj)

public override bool Equals(object obj)

Determines whether the specified object is equal to this endpoint.

Returns bool

GetHashCode()

public override int GetHashCode()

Returns a hash code for this endpoint.

Returns int

Parse(string s)

public static IPEndPoint Parse(string s)

Parses an "address:port" string into an IP endpoint.

Returns IPEndPoint

TryParse(string s, out IPEndPoint result)

public static bool TryParse(string s, out IPEndPoint result)

Attempts to parse an "address:port" string into an IP endpoint, returning whether it succeeded.

Returns bool

Fields

MinPort

public const int MinPort

The minimum value that can be assigned to the Port property.

MaxPort

public const int MaxPort

The maximum value that can be assigned to the Port property.