Skip to content
eduardgushchin edited this page Oct 22, 2026 · 1 revision

Home | API by Category | Complete API Index | API Status

Field Value
Full name Electron2D.IP
Namespace Electron2D
Kind class
Category API Networking

Overview

Provides process-wide hostname resolution, bounded queued lookups and network-interface snapshots.

Syntax

public sealed class Electron2D.IP

Remarks

Static operations address one retained object registered with Engine. Calls are thread safe; native DNS and interface enumeration are cold host work. Queue IDs remain occupied after completion until explicitly erased. Address snapshots belong to the caller. The process-wide object cannot be disposed.

Inherits: ElectronObject

Detailed engine reference

Members

Member Kind Summary
public const System.Int32 ResolverInvalidID = -1 constant Identifies failure to reserve a resolver queue slot.
public const System.Int32 ResolverMaxQueries = 256 constant Maximum simultaneous retained queue items, including completed items.
public static System.Void ClearCache(System.String host = "") method Removes cached host results without erasing queue items.
protected override System.Void Dispose(System.Boolean disposing) method
public static System.Void EraseResolveItem(System.Int32 id) method Erases a slot and cancels its pending lookup.
public static System.String[] GetLocalAddresses() method Snapshots all current local IPv4/IPv6 unicast addresses.
public static Electron2D.IPInterfaceInfo[] GetLocalInterfaces() method Snapshots the host's network adapters and current unicast addresses.
public static System.String GetResolveItemAddress(System.Int32 id) method Reads the first completed queue address without waiting.
public static System.String[] GetResolveItemAddresses(System.Int32 id) method Copies all completed queue addresses.
public static Electron2D.ResolverStatus GetResolveItemStatus(System.Int32 id) method Reads a queued lookup's phase without waiting.
public static System.String ResolveHostname(System.String host, Electron2D.IPType type = Any) method Resolves the first host address synchronously.
public static System.String[] ResolveHostnameAddresses(System.String host, Electron2D.IPType type = Any) method Resolves all distinct matching addresses synchronously.
public static System.Int32 ResolveHostnameQueueItem(System.String host, Electron2D.IPType type = Any) method Reserves a queue item and starts or reuses a lookup.
protected override System.Void ValidateDisposal() method

Member Details

ResolverInvalidID

Kind: constant

public const System.Int32 ResolverInvalidID = -1

Summary

Identifies failure to reserve a resolver queue slot.

ResolverMaxQueries

Kind: constant

public const System.Int32 ResolverMaxQueries = 256

Summary

Maximum simultaneous retained queue items, including completed items.

ClearCache(System.String)

Kind: method

public static System.Void ClearCache(System.String host = "")

Summary

Removes cached host results without erasing queue items.

Remarks

Older in-flight lookups cannot repopulate cleared cache entries; their queue results still complete normally.

Parameters

  • host: Empty clears all; otherwise all family entries for this exact spelling are removed.

Dispose(System.Boolean)

Kind: method

protected override System.Void Dispose(System.Boolean disposing)

EraseResolveItem(System.Int32)

Kind: method

public static System.Void EraseResolveItem(System.Int32 id)

Summary

Erases a slot and cancels its pending lookup.

Remarks

Late completion cannot publish into a reused slot or its cache entry. Existing caller snapshots stay valid.

Parameters

  • id: An in-range slot ID; an already erased slot is a no-op.

GetLocalAddresses()

Kind: method

public static System.String[] GetLocalAddresses()

Summary

Snapshots all current local IPv4/IPv6 unicast addresses.

Returns

A caller-owned array; interface ordering is not a routing preference.

GetLocalInterfaces()

Kind: method

public static Electron2D.IPInterfaceInfo[] GetLocalInterfaces()

Summary

Snapshots the host's network adapters and current unicast addresses.

Returns

A caller-owned typed array with adapter identifiers, names, string indexes and address arrays.

Exceptions

  • T:System.PlatformNotSupportedException: Native interfaces are unavailable on this target.

GetResolveItemAddress(System.Int32)

Kind: method

public static System.String GetResolveItemAddress(System.Int32 id)

Summary

Reads the first completed queue address without waiting.

Returns

A cached string, or empty unless Done.

Parameters

  • id: An in-range slot ID.

GetResolveItemAddresses(System.Int32)

Kind: method

public static System.String[] GetResolveItemAddresses(System.Int32 id)

Summary

Copies all completed queue addresses.

Returns

A caller-owned array, or empty unless Done.

Parameters

  • id: An in-range slot ID.

GetResolveItemStatus(System.Int32)

Kind: method

public static Electron2D.ResolverStatus GetResolveItemStatus(System.Int32 id)

Summary

Reads a queued lookup's phase without waiting.

Returns

None for an unused/erased slot.

Parameters

  • id: An in-range resolver slot ID.

ResolveHostname(System.String, Electron2D.IPType)

Kind: method

public static System.String ResolveHostname(System.String host, Electron2D.IPType type = Any)

Summary

Resolves the first host address synchronously.

Returns

A normalized address string, or empty when DNS fails or no matching address exists.

Parameters

  • host: A hostname or address literal; ordinal cache keys preserve the supplied spelling.
  • type: Any by default; None also selects the platform unspecified-family policy.

Exceptions

  • T:System.ArgumentException: The host is null or empty.
  • T:System.ArgumentOutOfRangeException: The family is undefined.
  • T:System.PlatformNotSupportedException: Native DNS is unavailable on this target.

ResolveHostnameAddresses(System.String, Electron2D.IPType)

Kind: method

public static System.String[] ResolveHostnameAddresses(System.String host, Electron2D.IPType type = Any)

Summary

Resolves all distinct matching addresses synchronously.

Returns

A caller-owned array; empty on DNS failure or no matching addresses. Host ordering is retained.

Parameters

  • host: A hostname or literal.
  • type: The requested family, Any initially.

ResolveHostnameQueueItem(System.String, Electron2D.IPType)

Kind: method

public static System.Int32 ResolveHostnameQueueItem(System.String host, Electron2D.IPType type = Any)

Summary

Reserves a queue item and starts or reuses a lookup.

Remarks

Completion can occur before return. Call EraseResolveItem after use; completion alone does not free a slot.

Returns

A slot in [0,255], or ResolverInvalidID when all slots remain occupied.

Parameters

  • host: A hostname or literal.
  • type: The requested family, Any initially.

ValidateDisposal()

Kind: method

protected override System.Void ValidateDisposal()

Remarks

The retained process-wide service has process lifetime.

Clone this wiki locally