Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!batcomputer!cornell!rochester!pt.cs.cmu.edu!ZEN.MT.CS.CMU.EDU!toad From: toad@CS.CMU.EDU (Todd Kaufmann) Newsgroups: comp.lang.perl Subject: non-blocking streams/rsh emulator (receptionist/client example) Message-ID: Date: 27 Mar 91 06:46:11 GMT Sender: toad@ZEN.MT.CS.CMU.EDU Distribution: comp Organization: School of Computer Science, Carnegie Mellon University Lines: 35 On most machines here in cs.cmu.edu we are running Mach, which don't usually have rsh (but of course perl runs on everything!). I've been playing with the receptionish & client examples from the camel book, but if the line doesn't have a newline after it, it isn't flushed. Simple example "demon" script: #!/bin/csh -f # test non-blocking io set flag=1 while ($flag) echo -n "prompt> " set ans=$< if ("$ans" == "q") set flag=0 echo Did you say $ans \? end exit 0 the problem is that the prompt isn't seen until a line has been entered (and then you see the previous prompt). I've tried (trial-n-error) to put in an ioctl call in receptionist (add CBREAK - wrong?), but that didn't seem to do it. rsh and telnet do this.. how? What am I doing wrong? Eventually I'd like to add passing sigint & sigquit to the remote end. Does anyone have that? .. oh yeah, I'm using perl 3.0, patch level 41. (and what about wait3?) thanks a bunch, Todd Kaufmann Center for Machine Translation CMU 412/ 268-7130