HTML automatically generated with rman
Table of Contents
tcppipe - create TCP connection to send data from/to pipe
tcppipe
[parameter=value]
TCPpipe is a very small program to transfer
any kind of data from one host to another over a network without the need
for ftp, scp, http
etc. To do this, first TCPpipe on one host must listen,
then TCPpipe on the other host can connect. After this the data can be transfered:
The sending TCPpipe reads from standard-input and sends it to the receiving
TCPpipe, which writes to standard-output. This allows to connect two processes
on different machines.
Several other implementation of the same idea exist,
with the same name.
The following parameters are recognized in
any order if the keyword is also given:
- host=name
- hostname, only needed
in receive mode [Default: none, i.e. program is started in send mode].
- port=tcp_port
- TCP/IP port to communicate with [Default: 2801]
- bufsize=byte_size
- buffersize
to use for transfer. Applies to both the sender and receiver, and best performance
should be expected when they are the same. [Default: 1024]
On
machine A you start by piping data into tcppipe, note no hostname is needed,
but we use the default port (2801) and buffersize (1024):
A% mkplummer - 1000 | tcppipe
After this has been launched, on machine B you can now tell it to expect
data from machine A and pass the data on to the task in the pipe:
B% tcppipe A | tsf -
Here are some cut and pasteable lines in C-shell that may be useful. Notice
the user of an "auto-incrementing" portnumber, since the usage of the bind/listen/accept
causes TCP/IP to lock that port for a few minutes:
dd if=/dev/zero of=zero1 bs=1024 count=1024
dd if=/dev/zero of=zero10 bs=1024 count=10240
dd if=/dev/zero of=zero100 bs=1024 count=102400
set port=3000
set host=192.168.1.6
set buf=10240
cat zero1 | tcppipe port=$port bufsize=$buf ; @ port++
tcppipe $host report=t port=$port bufsize=$buf; @ port++
@ port--
One possible future enhancement in NEMO would be to integrate this
with existing enhancements to stropen(3NEMO)
, the previous example would
now read
A% mkplummer + 1000
B% tsf +A
with a full filename syntax of +host:port/bufsize. Any of the three components
can be left off, but the separators must be kept not to confuse the parser.
A TCP/IP connnection that was used, will remain blocked for usage
on that same port for a little while (usually 60 seconds). Equally so, tcppipe
will only listen for so long until it gives up, it will not block that
port forever (check ???? - it certainly is a very long time)
redir(l)
,
nc(1)
, libpipeline(1)
socat - http://www.dest-unreach.org/socat/
libpipeline
- http://libpipeline.nongnu.org/
src/tools/tcppipe
Grischa Weberstaedt
(original), Peter Teuben (NEMO)
2001 Created Grischa Weberstaedt
02-Jul-01 V0.3 added user interface for NEMO PJT
10-feb-04 V0.4 added a reporting option, changed keyname PJT
Table of Contents