Questions tagged [hiredis]

Hiredis is a minimalistic C client library for the Redis database

Hiredis is a minimalistic C client library for the Redis database.

It is minimalistic because it just adds minimal support for the protocol, but at the same time it uses an high level printf-alike API in order to make it much higher level than otherwise suggested by its minimal code base and the lack of explicit bindings for every Redis command.

Apart from supporting sending commands and receiving replies, it comes with a reply parser that is decoupled from the I/O layer. It is a stream parser designed for easy reusability, which can for instance be used in higher level language bindings for efficient reply parsing.

Hiredis only supports the binary-safe Redis protocol, so you can use it with any Redis version >= 1.2.0.

The library comes with multiple APIs. There is the synchronous API, the asynchronous API and the reply parsing API.

Source Code: https://github.com/redis/hiredis

139 questions
1
vote
1 answer

hiredis SET runs into segmentation fault

I'm trying to SET a struct into Redis with hiredis: struct StatLite { uid_t uid; gid_t gid; mode_t mode; } bool RedisPermissionHandler::Set(std::string path, StatLite stat) { redisReply *reply =…
Cobra_Fast
  • 15,671
  • 8
  • 57
  • 102
1
vote
2 answers

Compile hiredis in C on Mac OS X

I'm trying to compile a client using hiredis in C on Mac OS X. I've installed hiredis with: brew install hiredis But still get the error: fatal error: 'hiredis.h' file not found My hiredis.h is however in: /usr/local/include/hiredis/hiredis.c How…
Alfred Balle
  • 1,135
  • 4
  • 16
  • 32
1
vote
0 answers

hiredis messages not arriving in subscribed handler

I have been working with hiredis as a client, everything e.g set, publish, etc works except for subscribe. I'm able to subscribe but can't get any message when I try to publish to the channel I've subscribed to. Here is the code I'm using: int…
Wafula Samuel
  • 530
  • 1
  • 8
  • 25
1
vote
1 answer

Client's interaction with Redis Cluster

I've started exploring Redis Cluster and it's C client(hiredis). I've been unable to find much info about the client's interaction with the Redis cluster. I've got some queries in this regard: Does the client make a connection with all the nodes of…
Vishal Sharma
  • 1,670
  • 20
  • 55
1
vote
0 answers

Different configurations for features test and rspec

I'm facing a strange issue after updated rails from 4.2 to 5.2. My features test needs following configuration to run config.redis_config = { driver: :hiredis, host: ENV['REDIS_HOST'] || 'redis', port: ENV['REDIS_PORT'] || 6379 } with above…
Asnad Atta
  • 3,855
  • 1
  • 32
  • 49
1
vote
0 answers

Using channels_redis on windows

I am trying to follow this basic django channels tutorial and I've gotten a pretty good start. I am able to successfully connect to my websocket and my consumer is properly echoing back to the front end when it receives a message. The next part of…
FoamyGuy
  • 46,603
  • 18
  • 125
  • 156
1
vote
0 answers

Methods in the Hiredis.h that are not defined

I have just started using hiredis as a c client to connect to redis for my c project in visual studio. Therefore, please pardon me if I seem to be unknowledgeable. Basically, the problem I have is I download the hiredis source from here:…
Irminrics
  • 21
  • 7
1
vote
1 answer

In hiredis async, can event_base_dispatch(base) be called from a different thread?

This query is with respect to the example provided in hiredis Can event_base_dispatch(base) be called from a different thread by creating pthread_create()? It is a fact that event_base_dispatch() is a loop and it is a blocking call. My idea here is…
Raja Narayan
  • 595
  • 5
  • 14
1
vote
0 answers

hiredis error message string is messy code

code snippet: std::function f = [data2, read_buf,key_name](const void *& buf, int& size) { auto ctx = data2->GetContext(); void *reply = NULL; auto status = redisGetReply(ctx,…
magenious
  • 11
  • 3
1
vote
1 answer

how to use List on Redis developing with C++ using hiredis

I try to use list with redis on Linux with C++ , how to use "rpush", "lpush", "rpop", "lpop" on C++? I wrote like these: this->_reply = (redisReply *) redisCommand(this->_context, "LPUSH %s %s", key.c_str(), value.c_str()); this->_reply =…
wikios
  • 35
  • 1
  • 8
1
vote
1 answer

Setting the TCP keepalive interval on the Hiredis async context

I'm writing a wrapper around hiredis to enable publish / subscribe functionality with reconnects should a redis node go down. I'm using the asynchronous redis API. So I have a test harness that sets up a publisher and subscriber. The harness then…
stack user
  • 835
  • 1
  • 9
  • 28
1
vote
1 answer

Storing vector of chars in Redis - containing NUL

I want to store a JPEG image in redis as a single key-value pair. From OpenCV, I get a std::vector jpeg from imencode() Now I convert this vector to std::string and SET it with Hiredis. The problem is that the jpeg vector contains NUL…
user2926577
  • 1,717
  • 4
  • 14
  • 16
1
vote
1 answer

Cannot install Flexisip (Linphone SIP server) on Centos 6.8

I am building Voice Call feature for Android app by using Linphone. On server (CentOS 6.8), I install Flexisip by tutorial on Homepage of Linphone wiki (https://wiki.linphone.org/wiki/index.php/Flexisip:installation). However in step 1, I cannot…
Quy Nguyen Vu
  • 181
  • 2
  • 13
1
vote
1 answer

Redis pub/sub serialized data struct C data

I'd like to store my serialized data on redis and publish to the channel that i've defined. But it seems that there is a problem on SETting the key value at redis. What do i miss for the solution ? Thanks in advance. #include #include…
1
vote
1 answer

Hiredis 0.5.2 on Windows

Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory:…
Richard Peck
  • 76,116
  • 9
  • 93
  • 147