lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hello Drake,

On Mon, Jan 17, 2011 at 6:51 PM, Drake Wilson <drake@begriffli.ch> wrote:
>> - as soon as the server crashes and the connection is somehow broken,
>> the client must do something
>
> You can't do that.  There is no way to detect that on the wire if you
> really want "as soon as"

That is the reason why I wanted to use keep-alive messages, as they
sounded a out-of-the-box solution which I could rely upon.

> TCP-level keepalives are not readily configurable at the application
> level in many common operating systems.  There is no standard socket
> option that I know of to set the timing from that side; I've only ever
> seen it done at the OS configuration level.

ok then. I will search for the default values used by the tcp stack on
Linux and OSX, out of curiosity.

> I wouldn't use them if there's another choice.  If you're designing
> the application protocol, provide a mechanism for application-level
> keepalives instead.

I am implementing a protocol [1] that rely on TCP to detect failures
of nodes, where 'an open tcp connection' is setup to a small set of
nodes. What I wanted is to detect when these connections are broken,
without any other heartbeat strategy.    I guess I will roll-back to
that approach nevertheless.

1 - http://docs.di.fc.ul.pt/jspui/bitstream/10455/2981/1/07-13.pdf

Thanks for the suggestions.
valerio