z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Format of the REXX socket function and return values

z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference
SC27-3660-00

You can issue socket commands in REXX by calling the built-in socket function.

Format

This function uses the following format, which is similar to that used to invoke C sockets:
Read syntax diagramSkip visual syntax diagram
                           .-,-------------.      
                           V               |      
>>-SOCKET--( - command--,----+-----------+-+--)----------------><
                             '-arguments-'        

Parameters

command
The socket API command to be issued, for example, SEND.
arguments
One or more parameters separated by a comma. All parameters are passed as space-delimited strings.

Returned value

The socket function returns a space-delimited string. If the REXX socket library can issue the socket command, the return value consists of the REXX TCP/IP error number value, the return code, and any additional socket information. If the REXX socket library cannot process the socket command, the return value consists of a REXX socket library error value and information about what caused the error.

Tip: For an error condition, the REXX socket library returns both the numeric and text versions of the error, for example, 2009 ESOCKETNOTDEFINED Socket not defined.

See Socket call error return codes for additional information about the numeric error codes that are returned by this command.

Example

Consider the following code sample:
src = socket(“ACCEPT”,l_socketid);
where:
  • "ACCEPT" is the socket command.
  • l_socketid is an argument that is required by the ACCEPT command. In this example, it specifies the socket descriptor of the listening socket.
When a new connection is available, the ACCEPT command returns the following string:
src = 0 45
where 0 is the return code, and 45 is the file descriptor of the new connection.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014