On Fri, 4 Nov 2005, Samuel Tardieu wrote:

> >>>>> "James" == James Yonan <j...@yonan.net> writes:
> 
> James> The management interface doesn't close the listening socket
> James> when it's connected to a client, because then it would need to
> James> reopen it after the client disconnects, and for various reasons
> James> this causes problems (especially when privileges have been
> James> dropped).
> 
> Can't you at least do a listen(fd,0) while a client is connected and
> revert to listen(fd,1) when the server is waiting?

[moving this thread to openvpn-devel]

Unfortunately that won't work.  The second parameter to listen() is only a
hint to the OS for advisory purposes.  Setting it to zero does not appear
to be a portable method of temporarily rejecting new connections.

Having said that, I don't particularly like the current behaviour.  It
would be nice if new connections would fail when a management client is
already connected.  The original version of the management interface
closed the listening socket once a client connected and reopened it when
the client disconnected.  This was only changed to the current behavior
when problems arose with the repeated closing and reopening of the
listening socket.

James


Reply via email to