Problem in socket application

F

FET

Hello everyone,
I have the following setup on a Linux box:

CLIENT APP --MySocket---> Xinetd -------> PROCESSOR APP

The Client and Processor applications are both written in Java.
MySocket is a class that contains a java.net.Socket and the associated
input/output streams. The Socket timeout in MySocket has been set to
100 seconds. Xinetd daemon is used to invoke the Processor app, which
comes up and does some interaction with the Client App and then exits.

Now I have made the Client multi-threaded so that the Client can start
any number of threads simultaneously (using command line args). Each
of these threads sends a request to the Processor and waits for a
response.

The Xinetd daemon has been configured to allow 200 instances of the
Processor app.

The problem I am facing is that after a certain number of threads of
the Client, I start getting "SocketTimeoutException: Read timed out"
while reading the response from the Processor app. After that, some
threads receive proper responses. After that, some threads give the
exception "Cannot connect to the Socket" (for the Processor app.).
These outputs are printed on System.out.

Is this a problem with the timeout settings ? Should I have an
infinite timeout ? Does the Java VM limit the number of simultaneous
threads started ? Do I have to change the scope of some variables in
the Processor App for such a setup to work ? Or does the OS have
something to do with it ?

Please advise me what to do as I have not programmed any application
with such requirements (simultaneous connections from over 100
clients). And also, there are simply too many parameters involved
here.

Thanks in advance.

Best regards.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top