From af9bf16953b2e559ec7ecd12a25d5ea97b879bb2 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Wed, 10 Jul 2013 21:08:15 -0700 Subject: Call aeStop on error conditions --- example-ae.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); } -- cgit v1.2.3