Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
GETSOCKNAME z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference SC27-3660-00 |
|
Use the GETSOCKNAME command to retrieve the name of a bound socket. Stream sockets are not assigned a name until after a successful BIND, CONNECT, or ACCEPT command is completed. Tip: Use
this command to discover the port number that is assigned to a socket
after the socket has been implicitly bound, for example, after a CONNECT
command has been completed.
Parameters
Returned valueThis command returns a string that contains the return code and the NAME string of the bound socket, for example, 0 AF_INET6 7 0 2001:197:11:103::1 0. The return code can be 0, a REXX socket API error number, or the REXX TCP/IP error number that is set by the socket command. The return code 0 indicates that the requested socket command was completed successfully. For information about the format of the NAME string, see How structures are represented. See Socket call error return codes for additional information about the numeric error codes that are returned by this command. The following REXX TCP/IP error numbers can be returned:
The following REXX socket API error numbers can be returned:
LE C/C++ equivalent
Code exampleFigure 1. GETSOCKNAME command
example
|
Copyright IBM Corporation 1990, 2014
|