shinberg / cpp-hiredis-cluster

c++ cluster wrapper for hiredis with async and unix sockets features
BSD 3-Clause "New" or "Revised" License
65 stars 26 forks source link

Connecting to a non-cluster node #24

Closed allthetime closed 6 years ago

allthetime commented 7 years ago

Is it possible to connect to a non-cluster node??

I have a program where depending on command line arguments I either want to connect to cluster or to a single instance outside of the cluster. While the version that connects to the cluster works just fine, the other gives me this and crashes...

terminate called after throwing an instance of 'RedisCluster::LogicError'
  what():
HERE??
Aborted (core dumped)

The HERE is a print statement that confirms the exact location of the crash which is:

printf("HERE??");
port = (port == NULL || port == 0) ? 6380 : port;
cluster_p = HiredisCommand<>::createCluster( "127.0.0.1", port );
printf("Redis Connection Made to %d ! \n", port);

Obviously, 'Connection Made is never printed"