Kqueue queries

James Bailie jimmy at mammothcheese.ca
Tue Jun 12 21:15:04 UTC 2007


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 at mammothcheese.ca>
http://www.mammothcheese.ca


More information about the freebsd-hackers mailing list