[Bug 10746] netcat server will hang after client try to close the connection

bugzilla at busybox.net bugzilla at busybox.net
Tue Feb 6 17:15:14 UTC 2018


https://bugs.busybox.net/show_bug.cgi?id=10746

--- Comment #2 from Denys Vlasenko <vda.linux at googlemail.com> ---
(In reply to teawater from comment #0)
> With a normal netcat:
> server:
> nc -l 6000

What is "normal netcat"?

Unfortunately, after original nc-1.10, a number of clones were made over the
years, and often the authers did not bother to keep them command-line
compatible.
For one, the "nc" above evidently listens on port 6000. This is not how nc-1.10
worked: it used -p PORT to set the port.

> With current upstream netcat:
> server:
> $ ./nc -l -p 12345
> 123
> Hang...
> client:
> $ ./nc 127.0.0.1 12345 <<END
> > 123
> > END
> hang...

It is not hung - it's waiting for data to showel from server side to client.
Type something on the server side and press Enter. You'll see.

You should use this to let server know there will be no input:

$ ./nc -l -p 12345 </dev/null

The "normal netcat" is evidently a badly copied clone: it thinks that getting
EOF on network side should stop the entire process.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the busybox-cvs mailing list