3 rget, rput \- network pipe
25 .de XS \" Example start
38 set up a TCP/IP channel to connect two processes together. They can looked
39 upon as a remote pipe. Consider the well known method of copying a
43 (cd src && tar cf \- .) | (cd dst && tar xfp \-)
45 If the directory tree is to be copied to another machine then one can
46 use the following command on the source machine:
48 cd src && rput foo tar cf \- .
50 And on the destination machine:
52 cd dst && rget \-h \fIsource-machine\fP foo tar xfp \-
56 is either a port number in C style decimal, octal or hex, or a random string
57 that is hashed to a port number.
59 uses this port number to open a TCP socket that
64 It is customary to start
68 will retry for 2 minutes trying to connect to the remote
71 After the connection is established either utility will execute
73 with the given arguments with the TCP channel as either standard output
74 (rput) or standard input (rget).
78 do not stay around for the command to finish, they simply overlay themselves
79 with the command. If no command is given then they will themselves copy
80 standard input into the TCP channel (rput), or output from the TCP channel
81 to standard output (rget). So these two commands have the same effect:
84 tar cf \- . | rput foo
86 The second form has two processes copying data instead of just
88 directly writing its output into the TCP channel. There is a better way to
89 waste processor cycles, namely to save bandwidth:
91 cd src && tar cf \- . | rput foo compress
93 cd dst && rget \-h \fIsource-machine\fP foo uncompress | tar xfp \-
98 can be very useful in the windowed environments we use these days. The
100 can be typed into the window that has a shell running on one machine, and
103 is then typed into the window that has a shell running on another machine.
104 This is easier than one of the two well known forms that use
107 cd src && tar cf \- . | rsh dest-machine "cd dst && tar xfp \-"
109 cd dst && rsh source-machine "cd src && tar cf \- ." | tar xfp \-
111 Especially since these forms require that one must be able to use
113 without a password, which may not always be the case.
117 can be any string of characters of any length. If its a number then it is
118 used directly as the port number. Otherwise the characters binary values
119 are multiplied together, bit 15 is set and the result is truncated to 16
120 bits to make it a port number in the anonymous port space (32768 \- 65535).
121 The port may be in-use on the source machine, but there is a small chance
122 of this happening, and if so simply choose another key. (So if you use
126 in an unattended script then you should reserve a port number, otherwise
127 a connection can't be guaranteed.)
131 These flags allow one to reverse the default connect/listen or input/output
136 Reversing the connection may be necessary if one of the two systems filters
137 out connections to unknown ports. For example:
139 rput \-c \-h \fIdestination-machine\fP foo tar cf \- .
141 rget \-l foo tar xfp \-
145 options can be used to choose which of standard input or output should be
146 tied to the socket. It's even possible to tie both input and output to the
149 but only when executing a command. This is probably the only use for these
150 options, because one usually chooses the direction with the mnemonic put/get
154 The name of the remote host that a connection must be made to. It must be
155 used with the program that is doing the connect, usually
157 This option is currently mandatory. The author is planning to increase
158 ease of use by letting the programs find each other with UDP broadcasts
165 If the port computed out of
169 Kees J. Bot <kjb@cs.vu.nl>