From owner-freebsd-hackers Thu Feb 22 12:32:51 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 64CFD37B4EC for ; Thu, 22 Feb 2001 12:32:48 -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 VAA18150 for ; Thu, 22 Feb 2001 21:32:42 +0100 (CET) (envelope-from thierry.herbelot@free.fr) Message-ID: <3A95776A.1E76A7B@free.fr> Date: Thu, 22 Feb 2001 21:32:42 +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: hackers@freebsd.org Subject: detecting a closing socket from a Lex/Yacc interpreter ? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hello, I'm currently writing a small interpreter for a client/server application. the Lex and Yacc files seem to be OK, as the tests are running fine (as long as there is only one client, and the client dos not close its socket ...) I still have one problem : the server has a single thread : the process accept()s a connection, then processes the commands (with yyparse()), and after the current client disconnects, gets back to listening to the socket, and so on. the problem is that the yyparse() function does not return when the socket is closed. I've had a look at the sources of ftpd, where yacc is used, but from what I've seen, the yylex() function has been hand written (which I would like not to do) I've added a <> target in the lex file, but it does not seem to detect the socket close() taker for any solution, TfH -- Thierry Herbelot To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message