How can I have a netcat connection terminate the sending half of a TCP connection if its input reaches EOF?
I have a (non-standard) TCP service which reads all its input (i.e. until the client sends its FIN), and only then starts processing the data and sending back a reply. I would like to use nc
to interact with this service. But at the moment the reply doesn't arrive at the nc
console, and using Wireshark I can see that nc
only terminates the sending side of the connection when it quits (e.g. because of a timeout). I found no command line option to change this behavior.
socat
as it says in the write direction it will transfer the eof then wait-t<timeout>
seconds on the read direction.nc
, it might well be that your comment is as much of an answer as I can get here. So I'd welcome seing that posted as such.