Threads & Sockets Issue

Discussion in 'Java' started by RA, Jan 27, 2006.

  1. RA

    RA Guest

    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?
    RA, Jan 27, 2006
    #1
    1. Advertising

  2. 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/computer-lang/java/gui/faq
    http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/
    Thomas Weidenfeller, Jan 27, 2006
    #2
    1. Advertising

  3. RA

    rajatag Guest

    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
    rajatag, Jan 27, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. wEEdpEckEr
    Replies:
    1
    Views:
    449
    _XaToA_
    Jan 3, 2004
  2. Jupiter5F

    Threads and Sockets

    Jupiter5F, Nov 14, 2003, in forum: C++
    Replies:
    4
    Views:
    2,303
    Jupiter5F
    Nov 14, 2003
  3. Julia Goolia

    tkinter, sockets and threads together

    Julia Goolia, Sep 11, 2003, in forum: Python
    Replies:
    4
    Views:
    529
    Steve Holden
    Sep 12, 2003
  4. Gonçalo Rodrigues

    Help needed in problem with Threads and sockets.

    Gonçalo Rodrigues, Dec 29, 2003, in forum: Python
    Replies:
    0
    Views:
    267
    Gonçalo Rodrigues
    Dec 29, 2003
  5. Rod Stephenson
    Replies:
    0
    Views:
    441
    Rod Stephenson
    Jun 22, 2004
Loading...

Share This Page