|
Boost Users : |
Subject: Re: [Boost-users] Linux TCP session stays ESTABLISHED when interface is removed
From: Steffen Heil (Mailinglisten) (lists_at_[hidden])
Date: 2013-09-26 03:45:45
Hi
> Yes and no. It's cleaner (invisible at the application layer, so won't confuse
> your protocol) but you have less control over it (and the defaults usually still
> take quite a long time to detect a disconnection).
You don't have less control over that.
But you need to write platform-specific code to configure it.
Under Windows as well as under Linux you can set the idle time, the interval per connection. Linux also lets you specify the retry coutner per connection.
> So if you're paying for the link itself it might be more expensive. If you're
> only paying for the application-layer data then it'll be cheaper.
Definitely not. Every byte you write will result in a tcp packet containing at least that byte and all header information.
And it will be acknowledged by the peer.
TCP-Keepalive sends packets without payload, so at least one byte less.
So unless, you send a zero byte message, you will create more traffic. Zero byte messages however will be ignored by the network stack.
Basically tcp keepalive is the method of choice for minimal traffic - as long as you stick to tcp...
Regards,
Steffen
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net