diff options
author | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2013-07-10 21:08:15 -0700 |
---|---|---|
committer | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2013-07-10 21:08:15 -0700 |
commit | af9bf16953b2e559ec7ecd12a25d5ea97b879bb2 (patch) | |
tree | 4568bbe03818628b71bf7937c14b4676b8bd9bee | |
parent | fc55afb1b672bd3e4f47c3befdcf782013fedac3 (diff) |
Call aeStop on error conditions
-rw-r--r-- | example-ae.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/example-ae.c b/example-ae.c index 0484a73..93f1a84 100644 --- a/example-ae.c +++ b/example-ae.c @@ -21,18 +21,21 @@ void getCallback(redisAsyncContext *c, void *r, void *privdata) { void connectCallback(const redisAsyncContext *c, int status) { if (status != REDIS_OK) { printf("Error: %s\n", c->errstr); + aeStop(loop); return; } + printf("Connected...\n"); } void disconnectCallback(const redisAsyncContext *c, int status) { if (status != REDIS_OK) { printf("Error: %s\n", c->errstr); + aeStop(loop); return; } - printf("Disconnected...\n"); + printf("Disconnected...\n"); aeStop(loop); } |