Not logged in
Log in now
Create an account
Subscribe to LWN
LWN.net Weekly Edition for May 16, 2013
A look at the PyPy 2.0 release
PostgreSQL 9.3 beta: Federated databases and more
LWN.net Weekly Edition for May 9, 2013
(Nearly) full tickless operation in 3.10
Nmap 5.00 released
Posted Jul 16, 2009 22:10 UTC (Thu) by fyodor (guest, #3481)
Posted Jul 16, 2009 22:58 UTC (Thu) by foom (subscriber, #14868)
-q secs quit after EOF on stdin and delay of secs
-k set keepalive option on socket
The -q argument is somewhat like ncat's --send-only, except that it allows receiving data too, as
long as you haven't closed stdin yet. I use that one a fair bit. Generally as -q0. I want the client to
be able to send and receive data, but to be in control of closing the connection.
The -k option is pretty self-explanatory -- it's useful when you're going through firewalls.
Although really, I don't know why SO_KEEPALIVE isn't just on by default in the network
stack with a timeout of 8 minutes, these days...
Posted Jul 17, 2009 8:26 UTC (Fri) by tialaramex (subscriber, #21167)
One of the things we should have learned from the "browser wars" era web experience is that meekly going along with whatever craziness is currently dominant doesn't get you progress, just more pain. The standard says your TCP connection doesn't need keep alive packets, so there's no reason to send them by default.
More practically, if I have a quiescent connection, and I pull the rug out from under it, then put the rug back before using it, I expect it not to notice. With SO_KEEPALIVE the OS will notice and drop the connection. So forcing SO_KEEPALIVE throws away a feature I use. No thanks.
Posted Jul 17, 2009 9:08 UTC (Fri) by tzafrir (subscriber, #11501)
Posted Jul 21, 2009 9:49 UTC (Tue) by tialaramex (subscriber, #21167)
Posted Jul 17, 2009 15:05 UTC (Fri) by foom (subscriber, #14868)
My home NAT (linksys) did this. (until I replaced it with a linux box). And a non-natting
firewall (Cisco, I think) at my workplace does this between certain internal networks!
I'm sure glad you have a non-broken network, but a great many people don't.
Posted Jul 17, 2009 17:30 UTC (Fri) by dlang (✭ supporter ✭, #313)
routers and firewalls don't have infinite resources, so if you never timeout 'idle' connections you will eventually crash instead and take out everything
Posted Jul 19, 2009 9:21 UTC (Sun) by dankamongmen (subscriber, #35141)
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds