Use the GETCLIENTID command to retrieve the client ID for the calling application. The client ID is the identifier by which the calling application is known to the TCP/IP address space.
.-,--AF_INET-. >>-SOCKET--(--"GETCLIENTID"--+------------+--)----------------->< '-,--domain--'
The command returns a string that contains the return code and the application identifier. The return code can be 0 or the REXX API error number. The return code 0 indicates that the requested socket command was completed successfully.
clientid = domain userid socketset
See Socket call error return codes for additional information about the numeric error codes that are returned by this command.
int getclientid(int domain, struct clientid *clientid);
/* REXX EZARXR06 */
/*
* This sample demonstrates the use of the GETCLIENTID
* socket command.
*/
src = socket("INITIALIZE","MYSET01");
if perror(src,"INITIALIZE") \= 0 then signal ENDPROGRAM;
src = socket("GETCLIENTID");
Say src;
ENDPROGRAM:
src = socket("TERMINATE","MYSET01");
src = perror(src,"TERMINATE");
exit 0;
/* This routine returns -1 if the first word if arg 1 is not zero */
perror: if word(arg(1),1) = 0 then return 0; else
Say arg(2) "Error : "arg(1);
return -1;