summaryrefslogtreecommitdiff
path: root/deps/hiredis/example-ae.c
diff options
context:
space:
mode:
Diffstat (limited to 'deps/hiredis/example-ae.c')
-rw-r--r--deps/hiredis/example-ae.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/deps/hiredis/example-ae.c b/deps/hiredis/example-ae.c
index 28c34dc9f..5ed34a3a6 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) {