neuecc/CloudStructures — pull request #3 by neptaco (2014-12-17 14:56:56+00:00)
Title: Added a keepAlive setting

- for config command restricted servers (etc. elasticache)
http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/ClientConfig.html

BookSleeve/RedisConnection
https://code.google.com/p/booksleeve/source/browse/BookSleeve/RedisConnection.cs

```csharp
///

/// Configures an automatic keep-alive PING at a pre-determined interval; this is especially
/// useful if CONFIG GET is not available.
///

public void SetKeepAlive(int seconds)
{
keepAliveSeconds = seconds;
StopKeepAlive();
if (seconds > 0)
{
Trace("keep-alive", "set to {0} seconds", seconds);
timer = new System.Timers.Timer(seconds * 500); // check twice in the interval; Tick will decide which (if either) to use
timer.Elapsed += (tick ?? (tick = Tick));
timer.Start();
}
}
```

If keepAlive not set, call to config command.
but Elasticache is restricted.

```csharp
///

/// Called during connection init, but after the AUTH is sent (if needed)
///

protected override bool OnInitConnection()
{
var result = base.OnInitConnection();

if (keepAliveSeconds < 0) // not known
{
var options = GetConfigImpl("timeout", true);
options.ContinueWith(x =>
{
```

redis setting for test (redis.conf)
```
rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52
or
rename-command CONFIG ""
```