Re: SocketServer design

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: William Stacey [MVP] (staceywREMOVE_at_mvps.org)
Date: 02/15/05


Date: Tue, 15 Feb 2005 15:38:26 -0500

You can have more then 64 open sockets. That begs a question on how many
you can actually create per process? Anyone know for sure or is limited
only by memory? You probably want to use a thread pool as others have said
if you will have that many connections at same time (or use async sockets
which some really like and others don't like so much). An interesting
server that uses this method is the open source Cassini Web server by MS.
Also used in their WebMatrix tool. IIRC, it uses the std thread pool to
queue connections and handle them via the queue. Worth looking at for tips
on how others approached the issue.

http://www.asp.net/Projects/Cassini/Download/
"Explore and Extend the Cassini Web Server"
http://www.devx.com/dotnet/Article/11711/0/page/1

-- 
William Stacey, MVP
http://mvp.support.microsoft.com
"Stuart" <stuart@stu.org.uk> wrote in message
news:37ekhtF59vg1qU1@individual.net...
> I need to write a socket server that accepts around 100 connections, but
> this could grow to a 1000, or more in time.  The data throughput will be
> minimal, mostly in short random bursts, but it's important those
> connections stay active.
>
> Having googled a bit, I understand there is a limit of 64 socket
> connections in .NET?  How do you overcome that?  Should I be creating a
> new Thread for every connection? It seems a bit wasteful, given the
> small amounts of data. (as little as 30 bytes in a 2 minute burst).
>
> Stuart.


Relevant Pages

  • sockets, closing and TIME_WAIT
    ... During heavy load the server can't follow anymore because the sockets ... my server should be able to handle 10 clients connecting ... This gets a free position in the array of connections, ...
    (comp.unix.programmer)
  • Re: network programming: how does s.accept() work?
    ... The program you contact at Google is a server. ... so, the server will usually assign a new port, say 56399, specifically ... connections to a server remain on the same port, ... sockets is what identifies them. ...
    (comp.lang.python)
  • Re: FOAK: ADSL Micro Filters
    ... what is the REN total of the units plugged into the sockets. ... I've always had terrible problems with our connections, ... and whether the new adsl modem was connected or not. ... IIRC to use UK bought phones in France, ...
    (uk.rec.motorcycles)
  • socket_select() hangs sometimes; Bug?
    ... socket_selectfor accepting new connections and dealing with existing ... The select runs on all connected sockets for read and ... the server hangs after some time. ...
    (php.general)
  • Re: high performance with a lot of outgoing connections
    ... >> outgoing connections, and it is possible to run the system out of ... >> ports under certain circumstances. ... >> a normal web server, or has a limited number of outgoing connections, ... As an option to get you more sockets. ...
    (comp.unix.bsd.freebsd.misc)