diff options
author | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2013-07-10 21:08:29 -0700 |
---|---|---|
committer | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2013-07-10 21:08:29 -0700 |
commit | a5e0de0d8587c6f42f0df475e01d19be5084a5fd (patch) | |
tree | 4568bbe03818628b71bf7937c14b4676b8bd9bee /example-ae.c | |
parent | bcf83543762577a9b0f5625c848b7061cc980f30 (diff) | |
parent | af9bf16953b2e559ec7ecd12a25d5ea97b879bb2 (diff) |
Merge branch 'example-ae'
Diffstat (limited to 'example-ae.c')
-rw-r--r-- | example-ae.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/example-ae.c b/example-ae.c index 5ed34a3..93f1a84 100644 --- a/example-ae.c +++ b/example-ae.c @@ -21,17 +21,22 @@ 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"); + aeStop(loop); } int main (int argc, char **argv) { @@ -44,7 +49,7 @@ int main (int argc, char **argv) { return 1; } - loop = aeCreateEventLoop(); + loop = aeCreateEventLoop(64); redisAeAttach(loop, c); redisAsyncSetConnectCallback(c,connectCallback); redisAsyncSetDisconnectCallback(c,disconnectCallback); |