C# Class NetworkCommsDotNet.Tools.IPTools

A collection of tools for dealing with IP addresses.
ファイルを表示 Open project: MarcFletcher/NetworkComms.Net

Public Methods

Method 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

Method Description
AttemptBestIPAddressGuess ( IPAddress targetIPAddress ) : IPAddress
GetBestInterface ( UInt32 DestAddr, UInt32 &BestIfIndex ) : int

Method Details

BestLocalEndPoint() public static method

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
return IPEndPoint

GetIPv4NetworkBroadcastAddress() public static method

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

ParseEndPointFromString() public static method

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
return IPEndPoint