Working in a multiple network stack environment

In a multiple network stack environment (CINET), when one of the stacks fails, no notification or Java™ exception occurs for a Java program that is listening on an INADDR_ANY socket. Also, when new stacks become available, the Java application does not become aware of them until it rebinds the INADDR socket.

To avoid this situation, when a TCP/IP stack comes online:
  • If the ibm.socketserver.recover property is set to false (which is the default), an exception (NetworkRecycledException) is thrown to the application to allow it either to fail or to attempt to rebind.
  • If the ibm.socketserver.recover property is set to true, Java attempts to redrive the socket connection on the new stack if listening on all addresses (addrs). If the socket bind cannot be replayed at that time, an exception (NetworkRecycledException) is thrown to the application to allow it either to fail or to attempt to rebind.

Both ServerSocket.accept() and ServerSocketChannel.accept() can throw NetworkRecycledException.

While a socket is listening for new connections, it maintains a queue of incoming connections. When NetworkRecycledException is thrown and the system attempts to rebind the socket, the connection queue is reset and connection requests in this queue are dropped.