From fc55afb1b672bd3e4f47c3befdcf782013fedac3 Mon Sep 17 00:00:00 2001 From: Erik Dubbelboer Date: Tue, 2 Jul 2013 19:24:02 +0200 Subject: Made example-ae work again --- example-ae.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'example-ae.c') diff --git a/example-ae.c b/example-ae.c index 5ed34a3..0484a73 100644 --- a/example-ae.c +++ b/example-ae.c @@ -32,6 +32,8 @@ void disconnectCallback(const redisAsyncContext *c, int status) { return; } printf("Disconnected...\n"); + + aeStop(loop); } int main (int argc, char **argv) { @@ -44,7 +46,7 @@ int main (int argc, char **argv) { return 1; } - loop = aeCreateEventLoop(); + loop = aeCreateEventLoop(64); redisAeAttach(loop, c); redisAsyncSetConnectCallback(c,connectCallback); redisAsyncSetDisconnectCallback(c,disconnectCallback); -- cgit v1.2.3 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(-) (limited to 'example-ae.c') 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