Previous Topic: &ZSHRINK

Next Topic: &ZSUBST


&ZSOCINFO

Obtains information about a specific socket owned by the process.

&ZSOCINFO socket_id infotype

&ZSOCINFO returns information according to the socket as identified by socket_id and the value of infotype as explained below.

Operands:

EXIST

Returns YES if the NCL process owns a socket with the specified socket ID or NO if the NCL process does not own a socket with the specified socket ID.

TYPE

Returns a character string representing the type of socket: TCP, TCPLISTEN, or UDP.

PORT

Returns the port number assigned to the socket by the local host.

ADDR

Returns the IP address assigned to the socket by the local host.

PEERPORT

Returns the port number of the peer host on a TCP connection.

For a UDP socket this is the port number last referenced by a SEND_TO or RECEIVE_FROM verb.

PEERADDR

Returns the IP address of the peer host on a TCP connection.

For a UDP socket this is the IP address last referenced by a SEND_TO or RECEIVE_FROM verb.

PEERNAME

Returns the name of the peer host on a TCP connection (where HOSTNAME was used to establish the connection).

RETCODE

Returns the return code from the last operation on this socket.

FDBK

Returns the reason code from the last operation on this socket.

VERRIN

Returns the vendor error information from the last operation on this socket.

ERRNO

Returns the error number value from the last operation on this socket.

BYTESIN

Returns the number of bytes of data received by this socket.

BYTESOUT

Returns the number of bytes of data sent by this socket.

Examples:

&STYPE = &ZSOCINFO &SOCK TYPE 
&WRITE DATA=SOCKET &SOCK IS &STYPE