Table of Contents

Class IPProtoEndPoint

Namespace
VAST.Transport
Assembly
VAST.Common.dll

Represents an IP endpoint with an associated protocol type.

public class IPProtoEndPoint : IPEndPoint
Inheritance
IPProtoEndPoint
Inherited Members

Remarks

This class extends IPEndPoint to include the protocol type (TCP, UDP, etc.), allowing endpoints to be distinguished not only by address and port but also by protocol.

Constructors

IPProtoEndPoint(long, int, ProtocolType)

Initializes a new instance of the IPProtoEndPoint class with the specified address, port, and protocol.

public IPProtoEndPoint(long address, int port, ProtocolType protocol)

Parameters

address long

The IP address as a 64-bit integer.

port int

The port number.

protocol ProtocolType

The protocol type.

IPProtoEndPoint(IPAddress, int, ProtocolType)

Initializes a new instance of the IPProtoEndPoint class with the specified address, port, and protocol.

public IPProtoEndPoint(IPAddress address, int port, ProtocolType protocol)

Parameters

address IPAddress

The IP address.

port int

The port number.

protocol ProtocolType

The protocol type.

IPProtoEndPoint(IPEndPoint, ProtocolType)

Initializes a new instance of the IPProtoEndPoint class from an existing endpoint with the specified protocol.

public IPProtoEndPoint(IPEndPoint endPoint, ProtocolType protocol)

Parameters

endPoint IPEndPoint

The IP endpoint to copy the address and port from.

protocol ProtocolType

The protocol type.

Properties

Protocol

Gets or sets the protocol type for this endpoint.

public ProtocolType Protocol { get; set; }

Property Value

ProtocolType

Methods

Equals(object)

Determines whether the specified object is equal to the current endpoint.

public override bool Equals(object comparand)

Parameters

comparand object

The object to compare with the current endpoint.

Returns

bool

true if the objects have the same address, port, and protocol; otherwise, false.

GetHashCode()

Returns a hash code for this endpoint.

public override int GetHashCode()

Returns

int

A hash code combining the base endpoint hash code with the protocol type.

IsNat(IPAddress)

Determines whether the specified IP address is a private (NAT) address.

public static bool IsNat(IPAddress address)

Parameters

address IPAddress

The IP address to check.

Returns

bool

true if the address is in a private address range (10.x.x.x, 172.16-31.x.x, or 192.168.x.x); otherwise, false.

ToString()

Returns a string representation of this endpoint.

public override string ToString()

Returns

string

A string in the format "address:port:protocol".

Operators

operator ==(IPProtoEndPoint, IPProtoEndPoint)

Determines whether two IPProtoEndPoint instances are equal.

public static bool operator ==(IPProtoEndPoint left, IPProtoEndPoint right)

Parameters

left IPProtoEndPoint

The first endpoint to compare.

right IPProtoEndPoint

The second endpoint to compare.

Returns

bool

true if both endpoints are equal or both are null; otherwise, false.

operator !=(IPProtoEndPoint, IPProtoEndPoint)

Determines whether two IPProtoEndPoint instances are not equal.

public static bool operator !=(IPProtoEndPoint left, IPProtoEndPoint right)

Parameters

left IPProtoEndPoint

The first endpoint to compare.

right IPProtoEndPoint

The second endpoint to compare.

Returns

bool

true if the endpoints are not equal; otherwise, false.