From owner-freebsd-hackers Fri Feb 23 22:23:58 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from herbelot.dyndns.org (s014.dhcp212-24.cybercable.fr [212.198.24.14]) by hub.freebsd.org (Postfix) with ESMTP id 1344237B401 for ; Fri, 23 Feb 2001 22:23:55 -0800 (PST) (envelope-from thierry.herbelot@free.fr) Received: from free.fr (multi.herbelot.nom [192.168.1.2]) by herbelot.dyndns.org (8.9.3/8.9.3) with ESMTP id HAA22278; Sat, 24 Feb 2001 07:23:28 +0100 (CET) (envelope-from thierry.herbelot@free.fr) Message-ID: <3A97535F.A9250B77@free.fr> Date: Sat, 24 Feb 2001 07:23:27 +0100 From: Thierry Herbelot X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.12 i386) X-Accept-Language: en MIME-Version: 1.0 To: Jordan DeLong Cc: hackers@FreeBSD.ORG Subject: Re: detecting a closing socket from a Lex/Yacc interpreter ? References: <3A95776A.1E76A7B@free.fr> <20010222140911.A9405@cx420564-b.tucson1.az.home.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Jordan DeLong wrote: > > I'm assuming right now you are just setting yyin to the fd for the socket. > What you're gonna want to do is define the macro YY_INPUT (see the man page for > details) so that it calls recv on your socket. and then if it errors you can > have YY_INPUT return as an EOF and your <> rule will work fine. > indeed, taking the very simple YY_INPUT code from the man page of lex did the trick (+ remembering to close the fd's associated to the socket ...) Thanks -- Thierry Herbelot To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message