Skip to content

Instantly share code, notes, and snippets.

@farukyildiz
Created July 6, 2021 11:27
Show Gist options
  • Save farukyildiz/f7fcad968d19d48fee3ca0a038ba2d5d to your computer and use it in GitHub Desktop.
Save farukyildiz/f7fcad968d19d48fee3ca0a038ba2d5d to your computer and use it in GitHub Desktop.
Redis with C
#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