Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 24236 - netcat lacks an option to terminate a connection on EOF
Summary: netcat lacks an option to terminate a connection on EOF
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High major
Assignee: SpanKY
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-10 09:03 UTC by jochen
Modified: 2003-08-20 21:02 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jochen 2003-07-10 09:03:01 UTC
netcat (nc) lacks the -q option (present for example on debian's version of it).
This option makes netcat exit when stdin (or whatever input you're using) sends
an EOF.

This options renders file transfer using nc more or less impossible, since you
always have to watch whether the file is already transfered or not... nc won't
stop on it's own

Reproducible: Always
Steps to Reproduce:
1. nc -l -p 31337 > /dev/null
2. dd if=/dev/urandom bs=1024 count=1 | nc localhost 31337
3.
Actual Results:  
nothing, nc hangs

Expected Results:  
nc exists after sending 1024 bytes to nirvana
Comment 1 SpanKY gentoo-dev 2003-08-20 21:02:40 UTC
ok, i added all the debian patches to cvs ... that gives us broadcast (-b) and your eof thang (-q) ... i had to tweak a few to make them work with the ipv6 patch we have ...

either way, we've got it now ...
also might be nice to note that i hope you dont plan on using your nc script anywhere but Gentoo and debian since they're the only ones that have -q support really :)