From owner-freebsd-net@FreeBSD.ORG Wed May 7 22:51:30 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 34AA037B401 for ; Wed, 7 May 2003 22:51:30 -0700 (PDT) Received: from web14205.mail.yahoo.com (web14205.mail.yahoo.com [216.136.172.151]) by mx1.FreeBSD.org (Postfix) with SMTP id AFAC043FBD for ; Wed, 7 May 2003 22:51:29 -0700 (PDT) (envelope-from neelnatu@yahoo.com) Message-ID: <20030508055129.37892.qmail@web14205.mail.yahoo.com> Received: from [67.112.203.175] by web14205.mail.yahoo.com via HTTP; Wed, 07 May 2003 22:51:29 PDT Date: Wed, 7 May 2003 22:51:29 -0700 (PDT) From: Neelkanth Natu To: Snofe Deng , freebsd-net@freebsd.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: Problem about kqueue. X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2003 05:51:30 -0000 --- Snofe Deng wrote: > thanks. and another problem is that: > if i register: > {ident, EVFILT_READ} > {ident, EVFILT_WRITE} > {ident, EVFILT_TIMER} > to kq; > > than I register: > {newident, EV_DELETE} , I do not set the filter's value, just set the > flags. > does this action will remove all pairs which ident equal the newident? No. I don't think so. Looking at the code, it seems you should get back an EINVAL. I don't have a machine handy to validate this though. best Neel > > > thanks! > > > > > > > > >From: Neelkanth Natu > >To: Snofe Deng , freebsd-net@freebsd.org > >Subject: Re: Problem about kqueue. > >Date: Wed, 7 May 2003 22:21:02 -0700 (PDT) > >MIME-Version: 1.0 > >Received: from web14204.mail.yahoo.com ([216.136.172.146]) by > mc8-f18.law1.hotmail.com with Microsoft SMTPSVC(5.0.2195.5600); Wed, 7 May > 2003 22:21:03 -0700 > >Received: from [67.112.203.175] by web14204.mail.yahoo.com via HTTP; Wed, > 07 May 2003 22:21:02 PDT > >X-Message-Info: JGTYoYF78jEHjJx36Oi8+Q1OJDRSDidP > >Message-ID: <20030508052102.14548.qmail@web14204.mail.yahoo.com> > >In-Reply-To: <20030506200419.D011.DSNOFE@hotmail.com> > >Return-Path: neelnatu@yahoo.com > >X-OriginalArrivalTime: 08 May 2003 05:21:03.0101 (UTC) > FILETIME=[9E5572D0:01C31521] > > > > > >--- Snofe Deng wrote: > > > 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? > > > >No. The EVFILT_TIMER ident has a different namespace than the > >file descriptor namespace. The fact that the ident value for TIMER > >is the same as the socket fd is of no significance. > > > > > 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? > > > >It is not a bug. Calling a close on a file descriptor will remove > >all kevents associated with that fd. So you don't have to explicitly > >delete them. > > > >However if you want to remove the EVFILT_TIMER event too, you have > >two choices: > >- Use EV_ONESHOT to automatically delete the kevent once it is > > delivered. > >- Explicitly delete it as you are doing above. > > > >best > >Neel > > > > > > > > when I use the second way, things worked ok. > > > Any one can help me? > > > thanks a lot! > > > > > > -- > > > Snofe Deng > > > > > > > > > _______________________________________________ > > > freebsd-net@freebsd.org mailing list > > > http://lists.freebsd.org/mailman/listinfo/freebsd-net > > > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > > > > > >__________________________________ > >Do you Yahoo!? > >The New Yahoo! Search - Faster. Easier. Bingo. > >http://search.yahoo.com > > _________________________________________________________________ > 与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.msn.com/cn > __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com