IP
Internet protocol (IP) support functions such as DNS resolution.
Internet protocol (IP) support functions such as DNS resolution.
IP contains support functions for the Internet Protocol (IP). TCP/IP support is in different classes (see StreamPeerTcp and TcpServer). IP provides DNS hostname resolution support, both blocking and threaded.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Properties1
SingletonProperty
public static IPInstance Singleton { get; }Methods10
ClearCachevoid
public static void ClearCache(string hostname = "");Removes all of a hostname's cached references. If no hostname is given, all cached IP addresses are removed.
| Name | Type | Default |
|---|---|---|
hostname | string | "" |
EraseResolveItemvoid
public static void EraseResolveItem(int id);Removes a given item id from the queue. This should be used to free a queue after it has completed to enable more queries to happen.
| Name | Type | Default |
|---|---|---|
id | int | — |
GetLocalAddressesstring[]
public static string[] GetLocalAddresses();Returns all the user's current IPv4 and IPv6 addresses as an array.
string[]GetLocalInterfacesReckfell.Collections.Array<Reckfell.Collections.Dictionary>
public static Reckfell.Collections.Array<Reckfell.Collections.Dictionary> GetLocalInterfaces();Returns all network adapters as an array. Each adapter is a dictionary of the form:
{
"index": "1", # Interface index.
"name": "eth0", # Interface name.
"friendly": "Ethernet One", # A friendly name (might be empty).
"addresses": ["192.168.1.101"], # An array of IP addresses associated to this interface.
}Reckfell.Collections.Array<Reckfell.Collections.Dictionary>GetResolveItemAddressstring
public static string GetResolveItemAddress(int id);Returns a queued hostname's IP address, given its queue id. Returns an empty string on error or if resolution hasn't happened yet (see IP.GetResolveItemStatus).
| Name | Type | Default |
|---|---|---|
id | int | — |
stringGetResolveItemAddressesReckfell.Collections.Array
public static Reckfell.Collections.Array GetResolveItemAddresses(int id);Returns resolved addresses, or an empty array if an error happened or resolution didn't happen yet (see IP.GetResolveItemStatus).
| Name | Type | Default |
|---|---|---|
id | int | — |
Reckfell.Collections.ArrayGetResolveItemStatusIP.ResolverStatus
public static IP.ResolverStatus GetResolveItemStatus(int id);Returns a queued hostname's status as a IP.ResolverStatus constant, given its queue id.
| Name | Type | Default |
|---|---|---|
id | int | — |
IP.ResolverStatusResolveHostnamestring
public static string ResolveHostname(string host, IP.Type iPType = IP.Type.Any);Returns a given hostname's IPv4 or IPv6 address when resolved (blocking-type method). The address type returned depends on the IP.Type constant given as ip_type.
| Name | Type | Default |
|---|---|---|
host | string | — |
iPType | IP.Type | IP.Type.Any |
stringResolveHostnameAddressesstring[]
public static string[] ResolveHostnameAddresses(string host, IP.Type iPType = IP.Type.Any);Resolves a given hostname in a blocking way. Addresses are returned as an Reckfell.Collections.Array of IPv4 or IPv6 addresses depending on ip_type.
| Name | Type | Default |
|---|---|---|
host | string | — |
iPType | IP.Type | IP.Type.Any |
string[]ResolveHostnameQueueItemint
public static int ResolveHostnameQueueItem(string host, IP.Type iPType = IP.Type.Any);Creates a queue item to resolve a hostname to an IPv4 or IPv6 address depending on the IP.Type constant given as ip_type. Returns the queue ID if successful, or IP.ResolverInvalidId on error.
| Name | Type | Default |
|---|---|---|
host | string | — |
iPType | IP.Type | IP.Type.Any |
intFields and constants2
ResolverInvalidIdField
public const long ResolverInvalidId = -1;Invalid ID constant. Returned if IP.ResolverMaxQueries is exceeded.
ResolverMaxQueriesField
public const long ResolverMaxQueries = 256;Maximum number of concurrent DNS resolver queries allowed, IP.ResolverInvalidId is returned if exceeded.
IP.ResolverStatus
| Value | Description |
|---|---|
Done = 2 | DNS hostname resolver status: Done. |
Error = 3 | DNS hostname resolver status: Error. |
None = 0 | DNS hostname resolver status: No status. |
Waiting = 1 | DNS hostname resolver status: Waiting. |