z/OS Communications Server: IP IMS Sockets Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Sample explicit-mode program flow

z/OS Communications Server: IP IMS Sockets Guide
SC27-3653-00

The client begins execution and obtains the host name and port number from startup parameters. It then issues SOCKET and CONNECT calls to establish connectivity to the specified host and port. Upon successful completion of the connect, the client sends the TRM, which tells the Listener to schedule the specified transaction (DLSI102). The Listener schedules that transaction and places a TIM on the IMS™ message queue. Finally, it issues a GIVESOCKET call and waits for the server to take the socket.

When the requested server (EZASVAS2) begins execution, it issues a GU call to obtain the TIM. Using addressability information from the TIM, it issues INITAPI and TAKESOCKET calls. The server then sends SERVER MSG #1 to the client.

When the client receives the message, it displays SERVER MSG #1 on stdout and then sends END CLIENT MSG #2 to the server, and displays a success message on stdout. It then blocks on another receive() until the server responds.

The server, upon receipt of a message with the characters END as the first 3 characters, sends SERVER MSG #2 back to the client and closes the socket.

When the client receives this message, it prints SERVER MSG #2 on stdout, closes the socket, and ends.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014