tar cf - stuff | dd | nc -N -l 12987
nc a.example.com 12987 | dd | tar tf -
On host A
dd prints its summary after
tar completes. Thus it is clear, that tar closes the pipe/file ->
165040+0 records in 165040+0 records out 84500480 bytes transferred in 25.464802 secs (3318325 bytes/sec)
On both hosts
nc happily sits there without exiting.
-N shutdown(2) the network socket after EOF on the input. Some servers require this to finish their work.
Thus on host A
nc should have seen
EOF, closed the damn socket and on host B
nc should have seen the TCP connection terminate and should have closed
How do I tell
nc to close
stdout / terminate on host B and terminate on host A.
-D (debug) does nothing.
nc can't even tell its version number... sigh
Both hosts are FreeBSD 10.3-RELEASE-p4, IPv4 only.