Previous Topic: &SOCKET CONNECT

Next Topic: &SOCKET GETHOSTBYNAME


&SOCKET GETHOSTBYADDR

Obtains name information for a specified host.

&SOCKETGETHOSTBYADDR ADDRESS=ip_address 
                   [ MDO=mdo_name ] 
                   [ WAIT=time ] 
                   [ TYPE={SYNC | ASYNC} ]

GETHOSTBYADDR is used to obtain the real name of the host at an IP address specified by the ADDRESS operand.

Operands:

ADDRESS=ip_address

(Mandatory) Specifies the IP address of the host about which information is required. No alias name information is returned.

MDO=mdo_name

Specifies the name of the Mapped Data Object (MDO) into which information about the host is to be formatted. The MDO is mapped by the $NMTCPHE map.

WAIT=time

Specifies the time (in seconds)to wait for the host to respond. The default value is 30 seconds.

TYPE={SYNC | ASYNC}

Indicates whether this is a synchronous (SYNC) or asynchronous (ASYNC) socket request.

If TYPE=ASYNC is specified, WAIT cannot be specified.

If TYPE=ASYNC is specified, the verb returns control immediately, and a notification message is queued to the dependent environment when GETHOSTBYADDR completes:

N00101 NOTIFY: TCP/IP EVENT: GETHOSTBYADDR RESOURCE: RC=rc RSN=rsn ERR=errno VERRIN=vendor_info ADDRESS=ip_address

The return MDO is available in $INT.USERMDO after &INTREAD receives the message.

Examples: &SOCKET GETHOSTBYADDR

&SOCKET GETHOSTBYADDR ADDRESS=172.24.91.45 
&WRITE NAME=&ZSOCHNM IPADDRESS=&ZSOCHADR

Return Codes:

0

Get successful

8

Get failed; see &ZFDBK for reason code, &ZSOCERRN and &ZSOCVERR for further error information.

Notes:

The information returned is set into the following NCL variables:

&ZSOCHNM contains the host name.

More information:

&SOCKET GETHOSTBYNAME