Pull out and deprecate old cluster code. New cluster code will not be merged yet.
This commit is contained in:
parent
640ad577d1
commit
dff8c02cfe
4 changed files with 58 additions and 9 deletions
|
@ -394,6 +394,8 @@ public:
|
|||
Phy<OneServiceImpl *> _phy;
|
||||
Node *_node;
|
||||
SoftwareUpdater *_updater;
|
||||
PhySocket *_localControlSocket4;
|
||||
PhySocket *_localControlSocket6;
|
||||
bool _updateAutoApply;
|
||||
unsigned int _primaryPort;
|
||||
volatile unsigned int _udpPortPickerCounter;
|
||||
|
@ -488,6 +490,8 @@ public:
|
|||
,_phy(this,false,true)
|
||||
,_node((Node *)0)
|
||||
,_updater((SoftwareUpdater *)0)
|
||||
,_localControlSocket4((PhySocket *)0)
|
||||
,_localControlSocket6((PhySocket *)0)
|
||||
,_updateAutoApply(false)
|
||||
,_primaryPort(port)
|
||||
,_udpPortPickerCounter(0)
|
||||
|
@ -513,6 +517,8 @@ public:
|
|||
virtual ~OneServiceImpl()
|
||||
{
|
||||
_binder.closeAll(_phy);
|
||||
_phy.close(_localControlSocket4);
|
||||
_phy.close(_localControlSocket6);
|
||||
#ifdef ZT_USE_MINIUPNPC
|
||||
delete _portMapper;
|
||||
#endif
|
||||
|
@ -652,6 +658,20 @@ public:
|
|||
return _termReason;
|
||||
}
|
||||
|
||||
// Bind local control socket
|
||||
{
|
||||
struct sockaddr_in lo4;
|
||||
memset(&lo4,0,sizeof(lo4));
|
||||
lo4.sin_family = AF_INET;
|
||||
lo4.sin_port = Utils::hton((uint16_t)_ports[0]);
|
||||
_localControlSocket4 = _phy.tcpListen((const struct sockaddr *)&lo4);
|
||||
struct sockaddr_in6 lo6;
|
||||
memset(&lo6,0,sizeof(lo6));
|
||||
lo6.sin6_family = AF_INET6;
|
||||
lo6.sin6_port = lo4.sin_port;
|
||||
_localControlSocket6 = _phy.tcpListen((const struct sockaddr *)&lo6);
|
||||
}
|
||||
|
||||
// Save primary port to a file so CLIs and GUIs can learn it easily
|
||||
char portstr[64];
|
||||
Utils::ztsnprintf(portstr,sizeof(portstr),"%u",_ports[0]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue