Parasol Framework
  • Gallery
  • API
  • Wiki
  • GitHub
    • Audio
    • Core
    • Display
    • Fluid
    • Font
    • Network
    • Vector
    • Audio
    • Sound
    • File
    • MetaClass
    • Module
    • StorageDevice
    • Task
    • Thread
    • Time
    • Compression
    • Config
    • Script
    • XML
    • Controller
    • BlurFX
    • ColourFX
    • CompositeFX
    • ConvolveFX
    • DisplacementFX
    • FilterEffect
    • FloodFX
    • ImageFX
    • LightingFX
    • MergeFX
    • MorphologyFX
    • OffsetFX
    • RemapFX
    • SourceFX
    • TurbulenceFX
    • WaveFunctionFX
    • Scintilla
    • ScintillaSearch
    • Bitmap
    • Clipboard
    • Display
    • Document
    • Font
    • Picture
    • Pointer
    • Surface
    • SVG
    • ClientSocket
    • HTTP
    • NetSocket
    • Proxy
    • Vector
    • VectorClip
    • VectorColour
    • VectorEllipse
    • VectorFilter
    • VectorGradient
    • VectorGroup
    • VectorImage
    • VectorPath
    • VectorPattern
    • VectorPolygon
    • VectorRectangle
    • VectorScene
    • VectorShape
    • VectorSpiral
    • VectorText
    • VectorTransition
    • VectorViewport
    • VectorWave

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
  AddressesSTRUCT []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/C++ prototype is Function(*NetLookup, ERR Error, const std::string &HostName, const std::vector<IPAddress> &Addresses).

The Fluid 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, CSTRING 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.
FailedThe address could not be resolved
ArgsInvalid arguments passed to function.
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, CSTRING 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.
FailedGeneral failure.
AllocMemoryA call to AllocMemory() failed to create a new memory block.
NullArgsFunction call missing argument value(s)
ResolveAddressResolves an IP address to a host name.
ERR nl::ResolveAddress(OBJECTPTR Object, CSTRING 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.
FailedThe address could not be resolved
ArgsInvalid arguments passed to function.
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, CSTRING 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.
FailedGeneral failure.
AllocMemoryA call to AllocMemory() failed to create a new memory block.
NullArgsFunction call missing argument value(s)
NetLookup class documentation © Paul Manias © 2005-2025

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-2025