isCOBOL Evolve : Appendices : Library Routines : C$SOCKET : CSOCKET-GETREMOTEADDRESS
CSOCKET-GETREMOTEADDRESS
This operation returns the hostname, IP address and port of the endpoint to which this socket is connected.
Syntax:
 CALL "C$SOCKET" USING CSOCKET-GETREMOTEADDRESS
                       socketHandle
                       CSOCKET-REMOTE-ADDRESS
                GIVING returnCode
Parameters:
CSOCKET-GETREMOTEADDRESS
Constant
 
socketHandle
USAGE HANDLE
Identifies the socket to be inquired.
CSOCKET-REMOTE-ADDRESS
Group item
Structure that receives the information. This group item, defined in issocket.def, has the following structure:
 
01  csocket-remote-address.
    03 csocket-remote-hostname   pic x(64).
    03 csocket-remote-ip-address pic x(15).
    03 csocket-remote-port       pic 9(5).
Return code:
returnCode can be any signed numeric data item and provides additional information:
0
Operation succeeded
1
Operation failed