[Bug 212162] netcat (nc) does not close TCP stream / exit after end of input stream

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Aug 25 22:17:17 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212162

            Bug ID: 212162
           Summary: netcat (nc) does not close TCP stream / exit after end
                    of input stream
           Product: Base System
           Version: 10.3-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: jeff at baitis.net

To reproduce, use two terminals. In the first, execute:
$ nc -l 2222

In the second terminal, execute:
$ echo "hi" | nc localhost 2222

This command will hang.


My expectation is that nc will terminate once the end of the input stream is
reached.

Contrast with the behaviour of socat, which seems correct. Try this command:
$ echo "hi" | socat - TCP:localhost:2222

Both listener and sender processes exit.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list