Kōtuku
  • Gallery
  • API
  • Wiki
  • GitHub
    • Audio
    • Config
    • Core
    • Display
    • Document
    • Font
    • HTTP
    • Network
    • Regex
    • SVG
    • Tiri
    • Vector
    • XML
    • XQuery
    • XRandR
      • Audio
      • MP3
      • Sound
      • File
      • MetaClass
      • Module
      • StorageDevice
      • Task
      • Thread
      • Time
      • Compression
      • CompressedStream
      • Config
      • LZMAStream
      • Script
      • Tiri
      • XML
      • XQuery
      • Controller
      • BlurFX
      • ColourFX
      • CompositeFX
      • ConvolveFX
      • DisplacementFX
      • FilterEffect
      • FloodFX
      • ImageFX
      • LightingFX
      • MergeFX
      • MorphologyFX
      • OffsetFX
      • RemapFX
      • SourceFX
      • TurbulenceFX
      • WaveFunctionFX
      • Scintilla
      • Bitmap
      • Clipboard
      • Display
      • Document
      • Font
      • Image
      • Pointer
      • Surface
      • SVG
      • ClientSocket
      • HTTP
      • NetClient
      • NetLookup
      • NetServer
      • NetSocket
      • Proxy
      • Gradient
      • GradientConic
      • GradientContour
      • GradientDiamond
      • GradientDiffusion
      • GradientDistal
      • GradientGouraud
      • GradientLinear
      • GradientMesh
      • GradientRadial
      • GradientVoronoi
      • Vector
      • VectorClip
      • VectorColour
      • VectorEllipse
      • VectorFilter
      • VectorGradient
      • VectorGroup
      • VectorImage
      • VectorPath
      • VectorPattern
      • VectorPolygon
      • VectorRectangle
      • VectorScene
      • VectorShape
      • VectorSpiral
      • VectorText
      • VectorTransition
      • VectorViewport
      • VectorWave
      • Linux Builds
      • Windows Builds
      • Customising Your Build
      • Kōtuku Objects
      • Kōtuku In Depth
      • Kōtuku Design Patterns
      • Coding With AI
      • Regex Manual
      • XML Comparisons
      • Tiri Reference Manual
      • Config API
      • Defer Syntax
      • GUI API
      • HTTP Server API
      • I/O API
      • JSON API
      • OAuth API
      • Options API
      • Proxy Server API
      • Tempus API
      • URL API
      • VFX API
      • Widgets
      • RIPL Reference Manual
      • Origo
      • Flute / Unit Testing
      • Tuku
      • Embedded Document Format
      • TDL Reference Manual
      • TDL Tools
      • Action Reference Manual
      • System Error Codes

NetLookup Class

Resolve network IP addresses and names using Domain Name Servers.

Use the NetLookup class for resolving network names to IP addresses and vice versa.

Structure

The NetLookup class consists of the following fields:

Access
NameTypeComment
 AddressesIPAddress[]List of resolved IP addresses.

A list of the most recently resolved IP addresses can be read from this field.

 CallbackFUNCTIONThis function will be called on the completion of any name or address resolution.

The function referenced here will receive the results of the most recently resolved name or address. The C++ prototype is Function(*NetLookup, ERR Error, std::string_view HostName, const std::vector<IPAddress> &Addresses).

The Tiri prototype is as follows, with results readable from the HostName and Addresses fields: function(NetLookup, Error).

 ClientDataINT64Optional user data storage
 FlagsNLFOptional flags
NameDescription
NLF::NO_CACHEContact the name service and do not use the local DNS cache.
 HostNameSTRINGName of the most recently resolved host.

The name of the most recently resolved host is readable from this field.

Actions

The following actions are currently supported:

FreeTerminate the object.
ERR FreeResource(*Object)

This routine may block temporarily if there are unresolved requests awaiting completion in separate threads.

Methods

The following methods are currently supported:

BlockingResolveAddressResolves an IP address to a host name.
ERR nl::BlockingResolveAddress(OBJECTPTR Object, STRVIEW Address)
ParameterDescription
AddressIP address to be resolved, e.g. 123.111.94.82.

BlockingResolveAddress() performs an IP address resolution, converting an address to an official host name and list of IP addresses. The resolution process requires contact with a DNS server and this will cause the routine to block until a response is received.

The results can be read from the HostName field or received via the Callback function.

Error Codes
OkayThe IP address was resolved successfully.
RetryRetry the operation (could not succeed at this time)
ArgsInvalid arguments passed to function
MemoryGeneral memory error
BufferOverflowA buffer overflow has occurred
SystemCallA call to the host system has failed
HostNotFoundThe address could not be resolved.
NullArgsFunction call missing argument value(s)
BlockingResolveNameResolves a domain name to an official host name and a list of IP addresses.
ERR nl::BlockingResolveName(OBJECTPTR Object, STRVIEW HostName)
ParameterDescription
HostNameThe host name to be resolved.

BlockingResolveName() performs a domain name resolution, converting a domain name to its official host name and IP addresses. The resolution process requires contact with a DNS server and the function will block until a response is received or a timeout occurs.

The results can be read from the Addresses field or received via the Callback function.

Error Codes
OkayOperation successful.
RetryRetry the operation (could not succeed at this time)
MemoryGeneral memory error
BufferOverflowA buffer overflow has occurred
SystemCallA call to the host system has failed
HostNotFoundThe host name could not be resolved.
NullArgsFunction call missing argument value(s)
ResolveAddressResolves an IP address to a host name.
ERR nl::ResolveAddress(OBJECTPTR Object, STRVIEW Address)
ParameterDescription
AddressIP address to be resolved, e.g. "123.111.94.82".

ResolveAddress() performs a IP address resolution, converting an address to an official host name and list of IP addresses. The resolution process involves contacting a DNS server. To prevent delays, asynchronous communication is used so that the function can return immediately. The Callback function will be called on completion of the process.

If synchronous (blocking) operation is desired then use the BlockingResolveAddress() method.

Error Codes
OkayThe IP address was resolved successfully.
FieldNotSetA required field value is undefined
SyntaxThe address is not a valid IP address literal.
NullArgsFunction call missing argument value(s)
ResolveNameResolves a domain name to an official host name and a list of IP addresses.
ERR nl::ResolveName(OBJECTPTR Object, STRVIEW HostName)
ParameterDescription
HostNameThe host name to be resolved.

ResolveName() performs a domain name resolution, converting a domain name to an official host name and IP addresses. The resolution process involves contacting a DNS server. To prevent delays, asynchronous communication is used so that the function can return immediately. The Callback function will be called on completion of the process.

If synchronous (blocking) operation is desired then use the BlockingResolveName() method.

Error Codes
OkayOperation successful.
NullArgsFunction call missing argument value(s)
NetLookup class documentation © Paul Manias © 2005-2026

IPADDR Type

Address types for the IPAddress structure.

NameDescription
IPADDR::V4
IPADDR::V6
NetLookup module documentation © Paul Manias © 2005-2026

NLF Type

Options for NetLookup

NameDescription
NLF::NO_CACHEContact the name service and do not use the local DNS cache.
NetLookup module documentation © Paul Manias © 2005-2026

IPAddress Structure

FieldTypeDescription
DataINT128-bit array for supporting both V4 (32-bit host order) and V6 (8-bit byte order) IP addresses.
TypeIPADDRIdentifies the address Data value as a V4 or V6 address type.
PortINTFor UDP packets, identifies the client port number in host byte order.
NetLookup class documentation © Paul Manias © 2005-2026