virgo-agent-toolkit / virgo-base-agent

A lightweight, cross-platform agent written in C with an embedded Luvit runtime
Apache License 2.0
42 stars 9 forks source link

Make socket timeout configurable for heartbeat messages #109

Open hub-cap opened 10 years ago

hub-cap commented 10 years ago

The heartbeat interval is configurable based on the endpoint response, as seen in

https://github.com/virgo-agent-toolkit/virgo-base-agent/blob/master/client/client.lua#L159

But the timeout is set to a constant +- a configurable jitter

https://github.com/virgo-agent-toolkit/virgo-base-agent/blob/master/client/client.lua#L166

it would be nice if

https://github.com/virgo-agent-toolkit/virgo-base-agent/blob/master/client/client.lua#L41

was configurable since its used to determine the timeout here

https://github.com/virgo-agent-toolkit/virgo-base-agent/blob/master/client/client.lua#L113-115

.... But it seems that HEARTBEAT_INTERVAL is a bit of a misnomer too.. Maybe want to change that up a bit to describe the timeout or separate the timeout into a different contstant altogether.

robert-chiniquy commented 10 years ago

Good point.

rphillips commented 10 years ago

We may still need to add in the heartbeat interval since the socket timeout is set to 10 seconds. Or change both.