diff options
Diffstat (limited to 'examples/example-ssl.c')
-rw-r--r-- | examples/example-ssl.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/examples/example-ssl.c b/examples/example-ssl.c index a90b78a..156f524 100644 --- a/examples/example-ssl.c +++ b/examples/example-ssl.c @@ -18,8 +18,12 @@ int main(int argc, char **argv) { const char *key = argv[4]; const char *ca = argc > 4 ? argv[5] : NULL; - struct timeval timeout = { 1, 500000 }; // 1.5 seconds - c = redisConnectWithTimeout(hostname, port, timeout); + struct timeval tv = { 1, 500000 }; // 1.5 seconds + redisOptions options = {0}; + REDIS_OPTIONS_SET_TCP(&options, hostname, port); + options.timeout = &tv; + c = redisConnectWithOptions(&options); + if (c == NULL || c->err) { if (c) { printf("Connection error: %s\n", c->errstr); |