I'm not sure what you mean by hanging. Do you mean it's not terminating? If so, do you know where it's stuck? Most likely, since the remote host hasn't closed the connection and therefor telnet is still running and hasn't closed the IN handle, while(<IN>) is blocked waiting for data. I also don't see any attempt at actually sending a command to the remote host. Is the user supposed to type that in? You'd have to do that yourself in that case. Are you printing a command but nothing happens? In that case you probably haven't read Suffering from Buffering.
Also, it seems you haven't quote understood what the file handles do - or is Trying a command on the remote machine? That is the only reason you should be printing it to OUT, but it doesn't seem likely to me.
Makeshifts last the longest.
In reply to Re^3: Modifying STDOUT and keeping control
by Aristotle
in thread Modifying STDOUT and keeping control
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |