Implement UNIX domain socket support for the RedisWriter class

refs #4991
This commit is contained in:
Gunnar Beutner 2017-02-13 09:33:26 +01:00
parent 7cbd30f93e
commit 8ad567ce99
2 changed files with 6 additions and 1 deletions

View File

@ -36,9 +36,13 @@ void RedisWriter::Start(bool runtimeCreated)
boost::thread thread(boost::bind(&RedisWriter::HandleEvents, this));
thread.detach();
String path = GetPath();
String host = GetHost();
m_Context = redisConnect(host.CStr(), GetPort());
if (path.IsEmpty())
m_Context = redisConnect(host.CStr(), GetPort());
else
m_Context = redisConnectUnix(path.CStr());
String password = GetPassword();

View File

@ -32,6 +32,7 @@ class RedisWriter : ConfigObject
[config] int port {
default {{{ return 6379; }}}
};
[config] String path;
[config] String password;
};