[ale] listen()

Joe jknapka at earthlink.net
Tue Feb 11 11:29:16 EST 2003


cfowler <cfowler at outpostsentinel.com> writes:

> I'm writing a server that will only accept one connection at a time.  IT
> will only service one.  It will then accept a new one after the one
> being serviced has terminated.  My questions is that listen(int socket,
> int backlog) does not do this for me.  I'm setting backlog to 0 and I've
> got clients waiting in the wings to be accept()ed.  But they could be
> waiting for an accept() for a very long time.  Depending on when the
> first client close()s its connection.  Does anyone know of a solution?
> 
> One solution could be to fork() a child that services the first
> connection.  The parent then closes() each new incoming connection until
> that child has terminated?

Gah. No. Just accept(), skip the listen(). I thought you were
"Mr.-I-Have-Every-Volume-Of-TCP/IP-Illustrated-On-My-Shelf"??? :-)

Cheers,

-- Joe Knapka
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale






More information about the Ale mailing list