Created
May 24, 2011 15:50
-
-
Save bmatheny/988962 to your computer and use it in GitHub Desktop.
hiredis assertion fails with no callbacks
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
int main (int argc, char **argv) { | |
int i = 0; | |
signal(SIGPIPE, SIG_IGN); | |
struct event_base *base = event_base_new(); | |
redisAsyncContext *c = redisAsyncConnect("127.0.0.1", 6379); | |
redisAsyncContext *c2 = redisAsyncConnect("127.0.0.1", 6379); | |
if (c->err) { | |
/* Let *c leak for now... */ | |
printf("main: Error: %s\n", c->errstr); | |
return 1; | |
} | |
if (c2->err) { | |
/* Let *c leak for now... */ | |
printf("main: Error: %s\n", c2->errstr); | |
return 1; | |
} | |
redisLibeventAttach(c,base); | |
redisLibeventAttach(c2,base); | |
redisAsyncSetConnectCallback(c,connectCallback); | |
redisAsyncSetDisconnectCallback(c,disconnectCallback); | |
redisAsyncSetConnectCallback(c2,connectCallback); | |
redisAsyncSetDisconnectCallback(c2,disconnectCallback); | |
event_base_dispatch(base); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment