X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/6eaad66373982aa9c1c0ff6b584c542670548d0e..c0caa1cf542d452fdc1eb74a7e5511c683ec5d5d:/deps/hiredis/example.c 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);