From owner-freebsd-hackers Fri May 18 8:43:54 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from InterJet.dellroad.org (adsl-63-194-81-26.dsl.snfc21.pacbell.net [63.194.81.26]) by hub.freebsd.org (Postfix) with ESMTP id 7ED3B37B422 for ; Fri, 18 May 2001 08:43:52 -0700 (PDT) (envelope-from archie@dellroad.org) Received: from arch20m.dellroad.org (arch20m.dellroad.org [10.1.1.20]) by InterJet.dellroad.org (8.9.1a/8.9.1) with ESMTP id IAA79312 for ; Fri, 18 May 2001 08:43:52 -0700 (PDT) Received: (from archie@localhost) by arch20m.dellroad.org (8.11.3/8.11.3) id f4IFfoq79682; Fri, 18 May 2001 08:41:50 -0700 (PDT) (envelope-from archie) From: Archie Cobbs Message-Id: <200105181541.f4IFfoq79682@arch20m.dellroad.org> Subject: Re: How to transfer data from netgraph node to user program? In-Reply-To: "from Roman V. Palagin at May 18, 2001 02:15:13 pm" To: "Roman V. Palagin" Date: Fri, 18 May 2001 08:41:50 -0700 (PDT) Cc: freebsd-hackers@freebsd.org X-Mailer: ELM [version 2.4ME+ PL82 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Roman V. Palagin writes: > When size of collected data about 10Kb, all works fine. But when I need to > send 400Kb in reply - oops, ng_xxx_show_data() returns ENOBUFS (I think > because ng_socket receive queue is full, nobody reads from socket). So, I > don't understand how I can transfer large amount of data :-\ Any ideas? FreeBSD 4.x will not allow a context switch from within the kernel. Therefore, it is possible to overflow a socket if you keep adding data to it without leaving the kernel... because the user process never gets a chance to read the data. Maybe you can set a short timeout in your node after writing a certain amount of data, return, and then write some more when the timer goes off. -Archie __________________________________________________________________________ Archie Cobbs * Packet Design * http://www.packetdesign.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message