[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Right way to emty stdin?
- From: Gilles Ganault <gilles.ganault@...>
- Date: Wed, 23 Feb 2011 14:21:15 +0100
On Wed, 23 Feb 2011 14:02:25 +0100, Michal Kolodziejczyk <firstname.lastname@example.org>
>io.read() by default reads whole line ('*l'). So you need to send it a
>line (ending with CR/LF, or CTRL+D for empty line), or close the input.
>Otherwise it waits in blocking read. You seem to expect it is
>non-blocking. Try io.read(0) and read the manual:
Thanks Michal, but according to those pages...
"When Asterisk starts an AGI script, it feeds the channel variables to
the script on standard input. "
"All communication with the AGI occurs over STDIN and STDOUT; [...]
When your program starts, Asterisk will stream a number of variables
to it, which it's in your interest to capture. "
... the server does end each line with a CRL/LF, ending with an empty
CR/LF line when done, so I can't figure out why the while loop never