mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 04:21:51 +00:00
headers: unify API across build options
This commit is contained in:
1 parent
bd9496e2ba
commit
e274ffd83b
8 files changed
+67
-90
No files matched your search
@@ -37,19 +37,17 @@ using namespace std::placeholders;
|
||||
|
||||
namespace dht {
|
||||
|
||||
DhtProxyServer::DhtProxyServer(std::shared_ptr<DhtRunner> dht, in_port_t port
|
||||
#if OPENDHT_PUSH_NOTIFICATIONS
|
||||
, const std::string& pushServer
|
||||
#endif // OPENDHT_PUSH_NOTIFICATIONS
|
||||
)
|
||||
: dht_(dht)
|
||||
#if OPENDHT_PUSH_NOTIFICATIONS
|
||||
, pushServer_(pushServer)
|
||||
#endif // OPENDHT_PUSH_NOTIFICATIONS
|
||||
DhtProxyServer::DhtProxyServer(std::shared_ptr<DhtRunner> dht, in_port_t port , const std::string& pushServer)
|
||||
: dht_(dht) , pushServer_(pushServer)
|
||||
{
|
||||
// NOTE in c++14, use make_unique
|
||||
service_ = std::unique_ptr<restbed::Service>(new restbed::Service());
|
||||
|
||||
#if !OPENDHT_PUSH_NOTIFICATIONS
|
||||
if (not pushServer.empty())
|
||||
std::cerr << "Push server defined but built OpenDHT built without push notification support" << std::endl;
|
||||
#endif
|
||||
|
||||
server_thread = std::thread([this, port]() {
|
||||
// Create endpoints
|
||||
auto resource = std::make_shared<restbed::Resource>();
|
||||
|
||||
Reference in new issue
Block a user