[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ale] listen()



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