I would like to know given an arbitrary connection string, how do I test if the connection to a Redis Server is established. Thanks!
Asked
Active
Viewed 371 times
1 Answers
2
Just run a command in a new client like PING, e.g:
try
{
using (var redis = new RedisClient(connectionString))
{
var connected = redis.Ping();
}
}
catch (Exception ex)
{
//connection failed
}

mythz
- 141,670
- 29
- 246
- 390