C# Class NetworkCommsDotNet.Tools.IPTools

A collection of tools for dealing with IP addresses.
Afficher le fichier Open project: MarcFletcher/NetworkComms.Net

Méthodes publiques

Méthode Description
BestLocalEndPoint ( IPEndPoint remoteIPEndPoint ) : IPEndPoint

Determines the most appropriate local end point to contact the provided remote end point. Testing shows this method takes on average 1.6ms to return.

GetIPv4NetworkBroadcastAddress ( IPAddress localIPAddress ) : IPAddress

Returns the network broadcast address for the provided local IP address

ParseEndPointFromString ( string ipAddressAndPort ) : IPEndPoint

Converts an IPAddress in string form (IPv4 or IPv6) with an appended port number, e.g. 192.168.0.10:10000 or ::1:10000, into an System.Net.IPEndPoint.

Private Methods

Méthode Description
AttemptBestIPAddressGuess ( IPAddress targetIPAddress ) : IPAddress
GetBestInterface ( UInt32 DestAddr, UInt32 &BestIfIndex ) : int

Method Details

BestLocalEndPoint() public static méthode

Determines the most appropriate local end point to contact the provided remote end point. Testing shows this method takes on average 1.6ms to return.
public static BestLocalEndPoint ( IPEndPoint remoteIPEndPoint ) : IPEndPoint
remoteIPEndPoint IPEndPoint The remote end point
Résultat IPEndPoint

GetIPv4NetworkBroadcastAddress() public static méthode

Returns the network broadcast address for the provided local IP address
public static GetIPv4NetworkBroadcastAddress ( IPAddress localIPAddress ) : IPAddress
localIPAddress IPAddress
Résultat IPAddress

ParseEndPointFromString() public static méthode

Converts an IPAddress in string form (IPv4 or IPv6) with an appended port number, e.g. 192.168.0.10:10000 or ::1:10000, into an System.Net.IPEndPoint.
public static ParseEndPointFromString ( string ipAddressAndPort ) : IPEndPoint
ipAddressAndPort string The IP and Port to be parsed
Résultat IPEndPoint