From owner-freebsd-hackers@FreeBSD.ORG Fri Mar 7 22:38:17 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D27F61065688 for ; Fri, 7 Mar 2008 22:38:17 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id AC1128FC32 for ; Fri, 7 Mar 2008 22:38:17 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 1540A46C1C; Fri, 7 Mar 2008 17:38:17 -0500 (EST) Date: Fri, 7 Mar 2008 22:38:17 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Vlad GALU In-Reply-To: Message-ID: <20080307223723.X42870@fledge.watson.org> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org Subject: Re: A (perhaps silly) kqueue question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2008 22:38:17 -0000 On Fri, 7 Mar 2008, Vlad GALU wrote: > I see an unusual symptom with one of our in-house applications. The main I/O > loop calls kevent(), which in turn returns two events with EV_EOF error set, > always for the same descriptors (they're both socket descriptors). As the > man page is not pretty clear about it and I don't have my UNP copy at hand, > I would like to ask the list whether the error events are supposed to be > one-shot or not. I wonder if it's returning one event for the read socket buffer, and one event for the write socket buffer, since there are really two event sources for each socket? Not that this is desirable behavior, but it might explain it. If you shutdown() only read, do you get back one EOF kevent and one writable kevent? Robert N M Watson Computer Laboratory University of Cambridge