X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/a1e97d692e3b9ed3cd6c8751a70665d832199fff..c0caa1cf542d452fdc1eb74a7e5511c683ec5d5d:/deps/hiredis/example.c?ds=sidebyside 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);