WsGetAddressName Procedure

Returns the server name for a specified address.

Syntax

[ sServerName = ] WsGetAddressName ( vAddress )

The WsGetAddressName procedure syntax has the following parts:

 

Name

Type

Description

sServerName

BString

Name of the host (PC). If using the DNS or similar resolution system, it is the Fully Qualified Domain Name (FQDN) that caused the server to return a reply. If using a local hosts file, it is the first entry after the IP address. 

vAddress

Val Long

The address in network byte order. ATEasy 2024. lAddress changed to vAddress (Variant) to accommodate IPv6 addresses (16 bytes array). For IPv4 the return value is 4 bytes (vtI4)

Comments

The function was updated in ATEasy 2024 (v13) to support IPv6 addresses and also added support for specifying address as a string.

The vAddress can be one of the following:

        Pv4 string (vtBstr) address in the format x.x.x.x,, or long number (vtI4).

        IPv6 string address (x:x:x:x:x:x:x:x%s or shorter notations using ::, %s is scope id), or it can be an array of 16 elements (vtUI1 or vtArray) as returned from GetAddress().

Example

The following is an example of a combination of WsGetNameAddress and WsGetAddressName:

print WsGetAddressName("206.165.39.166")   ! or in hex  CE.A5.27.A6
print WsGetAddressName(0xA627A5Ce)         ! network byte order

print WsGetAddressName("fe80::9ce6:108:f120:4704%2")

Print ("::1")   ! local host name

!UNIT255-1

!UNIT255-1

!UNIT208

!UNIT208

See Also

WsBind, WsGetAddress, WsGetName, WsGetNameAddress