Created
July 6, 2021 11:27
-
-
Save farukyildiz/f7fcad968d19d48fee3ca0a038ba2d5d to your computer and use it in GitHub Desktop.
Redis with C
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
#include <stdio.h> | |
#include <hiredis.h> | |
struct timeval timeout = { 1, 500000 }; | |
int main() | |
{ | |
redisContext *c; | |
c = redisConnectWithTimeout("127.0.0.1", 6379, timeout); | |
redisReply *reply; | |
reply = redisCommand(c,"SET %s %s", "faruk", "yildiz"); | |
freeReplyObject(reply); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment