summaryrefslogtreecommitdiff
path: root/example-libevent.c
diff options
context:
space:
mode:
authorPieter Noordhuis <pcnoordhuis@gmail.com>2011-06-27 23:55:25 +0200
committerPieter Noordhuis <pcnoordhuis@gmail.com>2011-06-27 23:55:25 +0200
commit0625e7c5fe9cb99d5c6eca6961dac8da00566a36 (patch)
tree967042f530acd582b797de8b2e2b1ee50eaa92f5 /example-libevent.c
parent3313bcd1912abdced96bc995ede22836c67bcd9d (diff)
Update examples
Diffstat (limited to 'example-libevent.c')
-rw-r--r--example-libevent.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/example-libevent.c b/example-libevent.c
index f6f8c83..9da8e02 100644
--- a/example-libevent.c
+++ b/example-libevent.c
@@ -15,16 +15,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");
+ printf("Disconnected...\n");
}
int main (int argc, char **argv) {