Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Feb 2001 07:23:27 +0100
From:      Thierry Herbelot <thierry.herbelot@free.fr>
To:        Jordan DeLong <fracture@allusion.net>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: detecting a closing socket from a Lex/Yacc interpreter ?
Message-ID:  <3A97535F.A9250B77@free.fr>
References:  <3A95776A.1E76A7B@free.fr> <20010222140911.A9405@cx420564-b.tucson1.az.home.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <<EOF>> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3A97535F.A9250B77>