Problem about kqueue.

Snofe Deng dsnofe at hotmail.com
Tue May 6 05:18:52 PDT 2003


If I register:
{ident, EVFILT_READ}
{ident, EVFILT_WRITE}
{ident, EVFILT_TIMER} 
pairs to kq;and all the piar with same ident which is a socket descriptor.
then I close(2) ident. Does this mean that all these three 
{ident, filter} pairs will be removed just after the descriptor isclosed?
or should I use:
EV_SET(&evs, ident, EVFILT_READ, EV_DELETE, 0, 0, NULL)
EV_SET(&evs, ident, EVFILT_WRITE, EV_DELETE, 0, 0, NULL)
EV_SET(&evs, ident, EVFILT_TIMER, EV_DELETE, 0, 0, NULL)
to delete these three pairs?

when I just closed the socket descriptor, the {ident,
EVFILT_READ/EVFILT_WRITE} are removed. but {ident, EVFILT_TIMER}
is still returned at next kevent(2) loop. Is it a bug? or why should
this happend?

when I use the second way, things worked ok.
Any one can help me?
thanks a lot!

-- 
Snofe Deng <dsnofe at hotmail.com>




More information about the freebsd-net mailing list