[Top][All Lists]

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

Re: [libmicrohttpd] shutdown of listen socket does not work on solaris 1

From: Christian Grothoff
Subject: Re: [libmicrohttpd] shutdown of listen socket does not work on solaris 10
Date: Mon, 19 Sep 2011 10:44:08 +0200
User-agent: KMail/1.13.7 (Linux/2.6.39-1-amd64; KDE/4.6.5; x86_64; ; )

On Monday, September 19, 2011 10:29:24 AM Frank Meier wrote:
> hi
> > Well, that would seem to solve the problem, but would introduce a
> > race.  With 'close', another thread might open a file or socket and
> > MHD's might then select/poll/accept on that unrelated socket.
> I'm not sure if I understand the race problem correctly. is it if we
> call close on listening socket, and a thread is entering accept() on
> this socket the descriptor is invalid and accept would return EBADF?

EBADF would be returned, except if another thread creates a fresh listen 
socket between the 'close' and the 'accept' (which may happen to get the same 
number as the socket that was just closed).  Hence it is a race (with MHD, we 
should not make assumptions about what the rest of the program might be 

Happy hacking,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]