[comp.unix.wizards] Strange behavior from rsh

johng@ecrcvax.UUCP (John Gregor) (01/22/88)

Problem: rsh does strange things with the last socketfull of data sent
	 by a remote process before it blocks for input.

Repeat by:  (and NO this is not how I ran into the problem...)
    1) run /usr/games/chess and know what the output should look like
       when you press return.  (i.e. gives display of board with rank
       at the bottom)

    2) now try rsh <remote-machine> /usr/games/chess and bang on return
       a few times.  You will get the board displayed, but you won't
       get the rank displayed.  Now if you hit return enough times
       (13-14) all of a sudden, you get a screenfull of only ranks.
       Also, if you ^D out, all the unprinted ranks appear.

Now I know the manual says that rsh is no good for interactive programs
like vi and rogue, but I don't see how it can get data out of order.

I have source, so If you have an explanation/fix I can understand
references to line #'s and variable names.

			    Thanks in advance
			       John Gregor
		    johng%ecrcvax.UUCP@germany.csnet
/--\|/--\|/--\|/--\|/--\|/--\|/--\|/--\|/--\|/--\|/--\|/--\|/--\|/--\|/--\|/--\|

chris@mimsy.UUCP (Chris Torek) (01/26/88)

In article <477@ecrcvax.UUCP> johng@ecrcvax.UUCP (John Gregor) writes:
>... I know the manual says that rsh is no good for interactive programs
>like vi and rogue, but I don't see how it can get data out of order.

Most likely, the program you are running prints some data to stdout
and some to stderr, and is not careful about buffering.  When talking
to a rsh socket, it is not talking to a tty, and stdio buffers things
differently.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@mimsy.umd.edu	Path:	uunet!mimsy!chris