Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Threads & Sockets Issue (http://www.velocityreviews.com/forums/t149704-threads-and-sockets-issue.html)

RA 01-27-2006 07:30 AM

Threads & Sockets Issue
 
Hello!

Background:
------------------

I have a server running in Windows 2003 that is waiting for connections
on a TCP port.

For each client that connects, two separate threads are started. One is
for reading the data coming in from the client. The other is for
writing data to the client from a synchronized Vector.

The server is easily able to handle loads of up to 150 - 200 clients
connected at the same time.

Problem:
-------------

The problem that arises is rather odd ... after 3-4 hours of running
properly, quite a few clients are booted out of the system. There are
exceptions in reading or, writing to their sockets and the server
thinks they are no longer available.

This "boot" results in 50-60% of the clients being disconnected
simultaneously.

Any ideas on why this is happening?


Thomas Weidenfeller 01-27-2006 08:54 AM

Re: Threads & Sockets Issue
 
RA wrote:
> This "boot" results in 50-60% of the clients being disconnected
> simultaneously.
>
> Any ideas on why this is happening?


The standard answer to such questions is:

Gather more data!

Use a network sniffer like Ethereal to find out what is going on on the
wire. Is there something happening in the network? Which site is closing
the connection. Is it closed or reset?

It tremendously helps to know which party is at fault (server, client,
network) and on what protocol level it happens, when trying to debug
such things.

/Thomas
--
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/...g/java/gui/faq
http://www.uni-giessen.de/faq/archiv....java.gui.faq/

rajatag 01-27-2006 11:42 AM

Re: Threads & Sockets Issue
 
Thank you for your reply.

After further debugging, I have noticed that the clients are being
booted off because the read thread is getting a socket exception.

This starts with any one client and then goes on to exceptions thrown
by other clients who are logged in.

What kind of information do you suggest I analyze from Ethereal? Seems
to me network activity is fine ...

Thanks!
RA



All times are GMT. The time now is 10:50 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.