Brian Candler wrote:
> Perhaps it would be helpful to distinguish symptoms from your assumed 
> causes.
> 
> Firstly, are you saying that the stdin.puts line never completes? You 
> need to prove this. I suggest:
> 
>     STDERR.puts "About to send..."
>     stdin.puts "Received 0"
>     STDERR.puts "Finished sending."
> 
> Thirdly, because of buffering, the stuff you wrote to stdin might not 
> actually be sent until you do
> 
>     stdin.flush

I've actually tried these myself; it doesn't get past the stdin.puts 
line, but rather only outputs the first line (where I'm using puts(), 
not STDERR.puts()). As for flush, I've tried calling it in a few 
different places - before the stdin.puts, after the stdin.puts, 
inbetween loops, but it doesn't seem to do anything.

I'll look into the other things you mentioned and post my results.

Brian Candler wrote:
> Of course, if it weren't for the "5 second delay" requirement, then it 
> could be written quite happily without a thread:

This is true; it works fine without a delay. The delay, unfortunately, 
is the crucial aspect that I've been trying to get to work from the 
beginning.
-- 
Posted via http://www.ruby-forum.com/.