On Thu, Jan 29, 2009 at 12:26:21PM +0530, Rajkumar S wrote:
> Help says -w is timeout for connects and final net reads, so nc should exit
> after 2 seconds, and it does exit when tested under linux, but not under
> openbsd.
check the obsd manpage, it is specifically different and does not mention
connects:'
---
-w timeout
If a connection and stdin are idle for more than timeout seconds,
then the connection is silently closed. The -w flag has no ef-
fect on the -l option, i.e. nc will listen forever for a connec-
tion, with or without the -w flag. The default is no timeout.
---
it is only for idles
> Am i doing some thing wrong or is this a bug in nc ?
the gnu nc is different than the obsd one, even tho they're (iirc) both
derived from the same source a while ago.
the one in gnu land's -w option does what you want regarding connect
timeouts.
the openbsd one does not.
--
jared