2019-09-24 06:04:01 +02:00
|
|
|
/*
|
|
|
|
* ws_redis_publish.cpp
|
|
|
|
* Author: Benjamin Sergeant
|
|
|
|
* Copyright (c) 2019 Machine Zone, Inc. All rights reserved.
|
|
|
|
*/
|
|
|
|
|
2020-06-11 07:30:55 +02:00
|
|
|
#include <ixredis/IXRedisServer.h>
|
2019-09-24 06:04:01 +02:00
|
|
|
#include <spdlog/spdlog.h>
|
|
|
|
#include <sstream>
|
|
|
|
|
|
|
|
namespace ix
|
|
|
|
{
|
|
|
|
int ws_redis_server_main(int port, const std::string& hostname)
|
|
|
|
{
|
|
|
|
spdlog::info("Listening on {}:{}", hostname, port);
|
|
|
|
|
|
|
|
ix::RedisServer server(port, hostname);
|
|
|
|
|
|
|
|
auto res = server.listen();
|
|
|
|
if (!res.first)
|
|
|
|
{
|
2019-12-25 06:55:34 +01:00
|
|
|
spdlog::info(res.second);
|
2019-09-24 06:04:01 +02:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
server.start();
|
|
|
|
server.wait();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
} // namespace ix
|