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


The REXX-EXEC RSCLIENT sample program for IPv4

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

The client sample program is a REXX socket program that shows you how to use the commands that are provided by the REXX sockets API. The program connects to the server sample program and receives data, which is displayed on the screen. It uses sockets in blocking mode.

After parsing and testing the input parameters, the RSCLIENT EXEC program obtains a socket set using the INITIALIZE command and a socket using the SOCKET command. The program then connects to the server and writes the user ID, the node ID, and the number of lines requested on the connection to the server. It reads data in a loop; the data is displayed on the screen until the data length is 0, which indicates that the server has closed the connection. If an error occurs, the client program lists the return code, determines the status of the socket set, and ends the socket set.

The server adds the EBCDIC new-line character to the end of each record, and the client uses this character to determine the start of a new record. If the connection is abnormally closed, the records that were partially received are not displayed.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014