From owner-freebsd-net@FreeBSD.ORG Tue May 6 05:18:52 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 1A9A737B401 for ; Tue, 6 May 2003 05:18:52 -0700 (PDT) Received: from hotmail.com (bay2-dav32.bay2.hotmail.com [65.54.246.89]) by mx1.FreeBSD.org (Postfix) with ESMTP id B4BE243F93 for ; Tue, 6 May 2003 05:18:51 -0700 (PDT) (envelope-from dsnofe@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 6 May 2003 05:18:51 -0700 Received: from 202.199.66.11 by bay2-dav32.bay2.hotmail.com with DAV; Tue, 06 May 2003 12:18:51 +0000 X-Originating-IP: [202.199.66.11] X-Originating-Email: [dsnofe@hotmail.com] Date: Tue, 06 May 2003 20:19:53 +0800 From: Snofe Deng To: freebsd-net@freebsd.org Message-Id: <20030506200419.D011.DSNOFE@hotmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.05.10 X-OriginalArrivalTime: 06 May 2003 12:18:51.0633 (UTC) FILETIME=[A7845E10:01C313C9] Subject: 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: Tue, 06 May 2003 12:18:52 -0000 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