Although you will probably not be writing a Listener program,
it is important that you match the sequence of calls issued by the
Listener when you write your client program. The Listener call sequence
is:
- INITIALIZE LISTENER
- INITAPI
- Connect the Listener to MVS™ TCP/IP
at Listener startup. (This call is used only in programs written to
the Sockets Extended interface.
- SOCKET
- Create a socket descriptor.
- BIND
- Allocate the local port for the socket. This port is used by
clients when requesting connection to IMS™.
- LISTEN
- Create a queue for incoming connections.
- WAIT FOR CONNECTION REQUEST
- SELECT
- Wait for an incoming connection request.
- ACCEPT
- Accept the incoming connection request; create a new socket descriptor
to be used by the server for this specific connection.
- READ
- Read TRM; determine the IMS TRANCODE.
- CHNG
- Change the modifiable alternate PCB to reflect the desired IMS TRANCODE.
- INQY
- Ensure the desired IMS TRANCODE
is available for scheduling.
- ISRT
- Use the alternate PCB to insert the transaction initiation message
(TIM) and pass control information and user input data to the server.
- GIVESOCKET
- Pass the newly created socket to the server.
- SYNC
- Schedule the requested transaction.
- SELECT
- Wait for the server to take the socket.
- CLOSE
- Release the socket.
- END OF CONNECTION REQUEST
-
- Return to "WAIT FOR CONNECTION REQUEST"
- SHUTDOWN LISTENER
- CLOSE
- Close the socket through which the Listener receives connection
requests from MVS TCP/IP.
- TERMAPI
- Disconnect the Listener from MVS TCP/IP
before shutting down.