Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Threads & Sockets Issue

Reply
Thread Tools

Threads & Sockets Issue

 
 
RA
Guest
Posts: n/a
 
      01-27-2006
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?

 
Reply With Quote
 
 
 
 
Thomas Weidenfeller
Guest
Posts: n/a
 
      01-27-2006
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/
 
Reply With Quote
 
 
 
 
rajatag
Guest
Posts: n/a
 
      01-27-2006
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
threads, sockets, pyopengl, pickle (and tkinter...) Rod Stephenson Python 0 06-22-2004 03:37 AM
sockets on client/server in threads? wEEdpEckEr Java 1 01-03-2004 11:23 PM
Help needed in problem with Threads and sockets. Gonšalo Rodrigues Python 0 12-29-2003 07:39 PM
Threads and Sockets Jupiter5F C++ 4 11-14-2003 09:43 PM
tkinter, sockets and threads together Julia Goolia Python 4 09-12-2003 11:57 AM



Advertisments