Windows service fix -- it helps if we actually launch the control socket thing.

This commit is contained in:
Adam Ierymenko 2014-10-29 23:57:54 -07:00
parent 8bd9f7d51d
commit 5ca20da7af
3 changed files with 15 additions and 6 deletions

View file

@ -37,6 +37,9 @@
#include "../../node/Defaults.hpp"
#include "../../node/Utils.hpp"
#include "../../control/NodeControlClient.hpp"
#include "../../control/NodeControlService.hpp"
#include "../../osnet/WindowsEthernetTapFactory.hpp"
#include "../../osnet/WindowsRoutingTable.hpp"
#include "../../osnet/NativeSocketManager.hpp"
@ -83,6 +86,8 @@ void ZeroTierOneService::threadMain()
restart_node:
try {
std::string authToken(ZeroTier::NodeControlClient::getAuthToken((ZeroTier::ZT_DEFAULTS.defaultHomePath + ZT_PATH_SEPARATOR_S + "authtoken.secret").c_str(),true));
ZeroTier::WindowsEthernetTapFactory tapFactory(ZeroTier::ZT_DEFAULTS.defaultHomePath.c_str());
ZeroTier::WindowsRoutingTable routingTable;
ZeroTier::NativeSocketManager socketManager(ZT_DEFAULT_UDP_PORT,0);
@ -94,6 +99,8 @@ restart_node:
_node = new ZeroTier::Node(ZeroTier::ZT_DEFAULTS.defaultHomePath.c_str(),&tapFactory,&routingTable,&socketManager,false,(const char *)0);
}
ZeroTier::NodeControlService controlService(_node,authToken.c_str());
switch(_node->run()) {
case ZeroTier::Node::NODE_RESTART_FOR_UPGRADE: {