Re: Sockets application with 200 clients
From: Parahat Melayev (parahat_at_momenttech.com)
Date: 02/03/05
- Next message: William DePalo [MVP VC++]: "Re: Net 1.1 install failure with Windows ME"
- Previous message: sccacobra: "Net 1.1 install failure with Windows ME"
- In reply to: Robin: "Sockets application with 200 clients"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 3 Feb 2005 06:15:56 +0200
Consider using Thread Pools
that
Threads already running and waiting for job to do.
Glance to queue subject will be helpful also...
"Robin" <Robin@discussions.microsoft.com> wrote in message
news:8753E4C0-DBB9-48FA-8503-C1BA0988C9E7@microsoft.com...
> I am developing a network server application that will connect to around
200
> clients. The client software is already developed so I have to work within
> this constraint.
>
> The server listens for connections from clients and establishes a socket
> connection. The socket remains active until either the server or client
is
> shutdown.
>
> The clients send data to the server when they have new data to send or
when
> a status request has been made by the server.
>
> Most examples I have seen close the socket after the message is received
or
> the response is sent. How do I handle the situation where I have to keep
the
> sockets open and listen for more messages?
>
> There are a couple of approaches I but I'm not sure which,if either, is
the
> best.
>
> 1. Use the Async sockets methods (BeginRead etc...) At the end of each
> message I start a new BeginRead to wait for the next message. The problem
I
> see with this method is that it would require a thread for each client.
The
> upper limit for clients is around 200. Is it reasonable to have 200
threads?
>
> 2. Poll the sockets to see which have data available for reading using
> .Available or .Select., then use the Async methods to read the data.
>
> Any help is greatly appreciated.
>
>
> --
> Robin
- Next message: William DePalo [MVP VC++]: "Re: Net 1.1 install failure with Windows ME"
- Previous message: sccacobra: "Net 1.1 install failure with Windows ME"
- In reply to: Robin: "Sockets application with 200 clients"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|