Obtains name and address details for a specified host.
&SOCKET GETHOSTBYNAME HOSTNAME=host_name
[ MDO=mdo_name ]
[ WAIT=time ]
[ TYPE={SYNC | ASYNC} ]
GETHOSTBYNAME is used to obtain the IP address and, if an alias name is used in the HOSTNAME parameter, the full real name of a specific host.
Operands:
(Mandatory) Specifies the name of the host about which information is required. If an alias name is used both the full real name and full alias name of the host are returned. If a real name is specified no alias name information is returned.
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.
Specifies the time (in seconds) to wait for the host to respond. The default value is 30 seconds.
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 GETHOSTBYNAME completes:
N00101 NOTIFY: TCP/IP EVENT: GETHOSTBYNAME RESOURCE: RC=rc RSN=rsn ERR=errno VERRIN=vendor_info HOSTNAME=host_name
The return MDO is available in $INT.USERMDO after &INTREAD receives the message.
Examples: &SOCKET GETHOSTBYNAME
&SOCKET GETHOSTBYNAME HOSTNAME=TESTMVS1 &WRITE NAME=&ZSOCHNM IPADDRESS=&ZSOCHADR
Return Codes:
Get successful
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:
| Copyright © 2009 CA. All rights reserved. |
|