X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/021321e0efc0fcc54645ee9016a229257e1d4ba7..cada7f9671da8af04400853bed3f3bc1790a522a:/deps/hiredis/example-ae.c?ds=inline diff --git a/deps/hiredis/example-ae.c b/deps/hiredis/example-ae.c index 28c34dc9..5ed34a3a 100644 --- a/deps/hiredis/example-ae.c +++ b/deps/hiredis/example-ae.c @@ -18,17 +18,20 @@ void getCallback(redisAsyncContext *c, void *r, void *privdata) { redisAsyncDisconnect(c); } -void connectCallback(const redisAsyncContext *c) { - ((void)c); - printf("connected...\n"); +void connectCallback(const redisAsyncContext *c, int status) { + if (status != REDIS_OK) { + printf("Error: %s\n", c->errstr); + return; + } + printf("Connected...\n"); } void disconnectCallback(const redisAsyncContext *c, int status) { if (status != REDIS_OK) { printf("Error: %s\n", c->errstr); + return; } - printf("disconnected...\n"); - aeStop(loop); + printf("Disconnected...\n"); } int main (int argc, char **argv) {