Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Jun 2007 17:08:22 -0400
From:      James Bailie <jimmy@mammothcheese.ca>
To:        cole@opteqint.net
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Kqueue queries
Message-ID:  <466F0B46.5060106@mammothcheese.ca>
In-Reply-To: <20070612204525.9598C13C4AD@mx1.freebsd.org>
References:  <20070612204525.9598C13C4AD@mx1.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Cole wrote:

 > I wanted to know, what must be done when the sockets/file
 > descriptors close.  Do I need to decrease number_events and
 > resort the events array so that all the active kevents are
 > sequential without any closed sockets still in that array?

It occurs to me, you might be trying to use kqueue like select(),
in that you are giving an input queue to every invocation of
kevent(), in the same way that select needs descriptor map
arguments for every invocation.  If that's the case, you don't
need to do this.  You only need to set read events for a
descriptor once.  kevent() will keep returning read events while
the descriptor is open and readable.

-- 
James Bailie <jimmy@mammothcheese.ca>
http://www.mammothcheese.ca



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?466F0B46.5060106>