From owner-freebsd-stable@FreeBSD.ORG Fri Feb 8 10:01:43 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE7FE16A418 for ; Fri, 8 Feb 2008 10:01:43 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by mx1.freebsd.org (Postfix) with ESMTP id 9B4F613C442 for ; Fri, 8 Feb 2008 10:01:43 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 0F0758FEFD; Fri, 8 Feb 2008 04:41:53 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Fri, 08 Feb 2008 04:41:53 -0500 X-Sasl-enc: Ha3IqUDcv0Z5+GxV+2LsGMoaOfZBl5IdF94UDk5WLzvi 1202463712 Received: from empiric.lon.incunabulum.net (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTP id 72A42BA97; Fri, 8 Feb 2008 04:41:52 -0500 (EST) Message-ID: <47AC23DF.5030306@FreeBSD.org> Date: Fri, 08 Feb 2008 09:41:51 +0000 From: "Bruce M. Simpson" User-Agent: Thunderbird 2.0.0.9 (X11/20080207) MIME-Version: 1.0 To: Paul References: <20080207133127.T50745@bsd4.nyct.net> In-Reply-To: <20080207133127.T50745@bsd4.nyct.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-stable@freebsd.org Subject: Re: kevent on UDP sockets X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2008 10:01:43 -0000 Paul wrote: > > I'm having trouble with kevent() in connection with UDP sockets > (6.2-STABLE). > > Registering an event seems to work, but when UDP packet arrives on the > socket, kevent returns with 0. > > Is there currently a working support for UDP sockets in kqueue/kevent, > or does it only apply to TCP sockets ? I can't recall specifics but I had a working routing daemon skeleton using UDP with kqueue around 5 years ago. I didn't use oneshot, and treated it much like select() i.e. the input event is level triggered, every time you call you should get the event. This is unlike WSAEventSelect() in Windows which is edge triggered. later BMS