Threads & Sockets Issue

R

RA

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?
 
T

Thomas Weidenfeller

RA said:
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
 
R

rajatag

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
 

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

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top