Created
May 20, 2011 15:29
-
-
Save bmatheny/983162 to your computer and use it in GitHub Desktop.
hiredis weirdness
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void | |
redis_connect_cb(const struct redisAsyncContext *c) { | |
struct node *n = c->data; | |
if ( !n || c->err ) { | |
ERROR_OUT("Node is null or error is %s\n", c->errstr); | |
return; | |
} else if ( !(c->c.flags & REDIS_CONNECTED) ) { | |
DEBUG_OUT("Not connected\n"); | |
return; | |
} else { | |
DEBUG_OUT("Successful connect to %s:%u %d\n", n->host, n->port, c->c.flags); | |
} | |
} | |
static void | |
redis_disconnect_cb(const struct redisAsyncContext *c, int status) { | |
if ( status == REDIS_OK ) { | |
DEBUG_OUT("Redis ok disconnect\n"); | |
} else { | |
DEBUG_OUT("Redis disconnect error. %d: %s\n", c->err, c->errstr); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[debug] src/server.c:285:redis_connect_cb(): Successful connect to 127.0.0.1:6381 2 | |
[debug] src/server.c:368:redis_disconnect_cb(): Redis disconnect error. 1: Connection refused |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment