Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


Share this Page URL
Help

No response from IMS or IMS Connect > TCP/IP socket timeouts - Pg. 299

Example 15-1 Using the VIEW PORT command to look for an active client /F IMSGCONN, VIEW PORT NAME(7003) HWSC0001I HWSC0001I HWSC0001I HWSC0001I PORT=7003 STATUS=ACTIVE CLIENTID USERID TRANCODE STATUS SECOND CLNTPORT IP-ADDRESS JORDI IVTJJ CONN 500 4879 009.001.039.119 TOTAL CLIENTS=1 RECV=0 CONN=1 XMIT=0 OTHER=0 In this example, we can see just one active client, using the clientID JORDI, active from the IP address 9.1.39.119. This client has been active for 500 seconds, so we know that our program has at least established communication with IMS Connect and has sent it a request to execute a transaction whose transaction code is IVTJJ. We can also tell from the connection status that IMS Connect has sent the transaction request to IMS and is still waiting for the output from that transaction to be returned by IMS. Of course, this a relatively easy case to spot. If we were trying to locate an IMS Connector for Java client that was using a generated clientID (in other words a client using a sharable persistent socket) in a heavily used environment, we might have found several active clients to identify our hung program. 15.1.2 TCP/IP socket timeouts A socket timeout occurs when the maximum wait time for a socket operation to complete is exceeded. You can specify this maximum wait time in several ways. If you are using IMS Connector for Java: If your application is built with generated code, you can set the socket timeout property value in the Web Services Description Language (WSDL) for the application or in the J2C connection factory. If you are coding directly to the CCI API, you can set the socket timeout value for an interaction using the setSocketTimeout() method of the IMSInteractionSpec. If a timeout then occurs, your program will get the exception shown in Example 15-2. Example 15-2 Exception thrown when a socket timeout occurs javax.resource.spi.CommException: ICO0113E: com.ibm.connector2.ims.ico.IMSTCPIPManagedConnection@7f462c4a.receive() error. Socket Timeout has occurred for this interaction. The Socket Timeout value specified was [50] milliseconds. [java.net.SocketTimeoutException: Read timed out] You can use the setSoTimeout() method of a Socket object if you are programming a non-IMS Connector for Java client in the Java programming language. Example 15-3 shows the exception thrown by the Socket class when the socket timeout in the Socket class is triggered. Your program should catch and handle this exception appropriately. Example 15-3 Exception thrown by the socket class when a timeout exception occurs java.io.InterruptedIOException: Read timed out You can also use the setsockopt() function with the SO_SNDTIMEO and SO_RCVTIMEO options if you are writing a C client program in a UNIX or UNIX-like environment. If a socket timeout occurs, your recv() call will return fewer bytes than requested, or you will get an error with errno=EWOULDBLOCK if there were no bytes to read. Chapter 15. IMS Connect client diagnostics 299