File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Sockets and Internet Protocols and the fly likes SocketException Using Pooled Sockets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "SocketException Using Pooled Sockets" Watch "SocketException Using Pooled Sockets" New topic

SocketException Using Pooled Sockets

Dom Incollingo

Joined: Dec 04, 2002
Posts: 7
Hello everyone,
I am working on a java application (JDK 1.3.1 running on Windows NT) that does a TCP/IP connection to a backend legacy system running on UNIX. This java application has been running successfully for over a year, using Sockets to send data to and receive data from the backend legacy system. A new Socket was instantiated for each transmission of data.
We are now trying to pool our sockets in order to improve efficiency. Each time the java application re-uses a Socket from the pool to communicate with the backend legacy system, a SocketException is thrown. We are able to send data from the java application to the legacy system. But when we try to receive data by invoking the 'read' method of the Socket's InputStream, we get a SocketException with the message "Connection shutdown: JVM_recv in socket input stream read." I have verified that the Socket's 'close' method is not being called.
Does anyone have any ideas about what may be causing this exception or how I can resolve it? Thanks very much for your help.
Peter den Haan
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
Neither the socket InputStream, nor the socket at the other end is being closed?
- Peter
Dom Incollingo

Joined: Dec 04, 2002
Posts: 7
Nothing is being closed on the client side (the java application). Someone I work with suggested that we may be having a problem on the server side(UNIX legacy system) - that perhaps UNIKIX is locking the socket.
I agree. Here's the link:
subject: SocketException Using Pooled Sockets
It's not a secret anymore!