C client library for Valkey/Redis Cluster. This project is used and sponsored by Ericsson. It is a fork of the now unmaintained hiredis-vip.
BSD 3-Clause "New" or "Revised" License
86
stars
42
forks
source link
The connection always been close after every redisClusterCommandArgv #197
Closed
yanrk closed 8 months ago
` cc = redisClusterContextInit(); check_if_exit(cc, NULL); result = redisClusterSetOptionAddNodes(m_redis_cluster_context, "192.168.10.5:6379,192.168.10.5:6380,192.168.10.5:6381,192.168.10.5:6382,192.168.10.5:6383,192.168.10.5:6384"); check_if_exit(result, REDIS_OK); result = redisClusterSetOptionUsername(m_redis_cluster_context, m_redis_username.c_str()); check_if_exit(result, REDIS_OK); result = redisClusterSetOptionPassword(m_redis_cluster_context, m_redis_password.c_str()); check_if_exit(result, REDIS_OK); result = redisClusterSetOptionConnectTimeout(m_redis_cluster_context, m_redis_timeout); check_if_exit(result, REDIS_OK); result = redisClusterSetOptionRouteUseSlots(m_redis_cluster_context); check_if_exit(result, REDIS_OK); result = redisClusterConnect2(m_redis_cluster_context); check_if_exit(result, REDIS_OK);
redisClusterCommandArgv(cc, argc1, argv_array1, argv_size1); system("netstat -ano | findstr 192.168.10.5"); redisClusterCommandArgv(cc, argc2, argv_array2, argv_size2); system("netstat -ano | findstr 192.168.10.5"); redisClusterCommandArgv(cc, argc3, argv_array3, argv_size3); system("netstat -ano | findstr 192.168.10.5"); redisClusterCommandArgv(cc, argc4, argv_array4, argv_size4); system("netstat -ano | findstr 192.168.10.5"); `
why connection always been close after redisClusterCommandArgv(), is there option for reuse the connection?