simple script for connect server:
#include "hiredis.h"
int main(void) {
int fd;
unsigned int j;
redisReply *reply;
reply = redisConnect(&fd, "test.com", 6379);
if (reply != NULL) {
printf("Connection error: %s", reply->reply);
exit(1);
}
reply = redisCommand(fd,"PING");
printf("PONG: %s\n", reply->reply);
freeReplyObject(reply);
}
if the server is available - everything is normal. If not - there is a long pause. How to reduce the waiting time to 2 seconds for example ?