On Mon, Dec 01, 2014 at 21:51, Theo de Raadt wrote: >> Currently, 'nc -l <port>' can only process one TCP connection to the >> same port at a time, because it keeps the listening socket open during >> communication, therefore preventing others to connect to the other >> instances of 'nc' on the same port. >> >> Attached patch moves close() call up to be right after accept and before >> communication. > > > And now let's ask the question which matters. What usage patterns do > you break with this change? > > Did you think of that? Or are you only thinking of your own uses..?
The original netcat closed the listening socket immediately after accept(). The current behavior of continuing to listen on a socket that will never have accept called again seems to be a mistake introuced when it was rewritten and the k option was added.
