Peter Duniho
11/4/2008 7:07:00 AM
(microsoft.public.dotnet.framework and microsoft.public.vc.mfc removed
from follow-ups...there's really nothing in this thread related to either)
On Mon, 03 Nov 2008 22:45:34 -0800, Ashutosh Bhawasinka
<discussion@ashutosh.in> wrote:
> 1 Million connection! That's too much....But I suppose not all will
> connect at a time.
It is theoretically possible, on a robust enough server.
> Windows XP SP2 had limited the number of simultaneous TCP connection to
> 10. You should be using a server grade OS
This is definitely true.
> The server application can listen on a fixed port say 5000. When a
> client connects to the server, the server will receive the connection
> request and will create a new socket (this is done automatically) and
> will communicate with this new client using the new socket. It won't use
> the initial (server) socket for communicating with the client. The
> server application will continue to listen on port 5000 for new clients.
> This port will be used only for the clients to connect to the server. No
> data will be sent or received on this port/endpoint.
This is definitely not.
If the server port is 5000, then that's the port that _all_ of the
connections will use. It's true that a new socket will be created for
each connection, but they will all use the same port number.
> After a client has connected to you server application, you can then
> initiate a new connection to the client if you want to have 2 different
> sockets for 2 way communication.
Sockets are already bidirectional. There's no need to create a second
connection for two-way communication.
> Keeping the connection forever ??? why?? You will end up eating all the
> system resources!! You must use a better design.
If the clients are constantly in communication with the server, then
keeping the connection open as long as the client wants is better than
having the client repeatedly close and reopen connections. It really just
depends on what the application here is.
I'd say the most important thing for the OP to do is not cross-post so
widely. If he wants expert advice, he needs to post only to the
newsgroups where the network experts are participating. Posting to .NET
and/or MFC newsgroups, he's as likely to get bad information as good.
Pete