X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/6eaad66373982aa9c1c0ff6b584c542670548d0e..f6da155bde4c187325deee8b40fe41d45f40468d:/deps/hiredis/example.c?ds=inline diff --git a/deps/hiredis/example.c b/deps/hiredis/example.c index 2506f39c..90ff9ed5 100644 --- a/deps/hiredis/example.c +++ b/deps/hiredis/example.c @@ -9,7 +9,8 @@ int main(void) { redisContext *c; redisReply *reply; - c = redisConnect((char*)"127.0.0.1", 6379); + struct timeval timeout = { 1, 500000 }; // 1.5 seconds + c = redisConnectWithTimeout((char*)"127.0.0.2", 6379, timeout); if (c->err) { printf("Connection error: %s\n", c->errstr); exit(1);