mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-21 05:43:59 -07:00
Introduced basic multipath support
This commit is contained in:
parent
836d897aec
commit
6a2ba4baca
17 changed files with 1314 additions and 45 deletions
|
@ -388,6 +388,7 @@ public:
|
|||
_bindings[_bindingCount].udpSock = udps;
|
||||
_bindings[_bindingCount].tcpListenSock = tcps;
|
||||
_bindings[_bindingCount].address = ii->first;
|
||||
phy.setIfName(udps, (char*)ii->second.c_str(), ii->second.length());
|
||||
++_bindingCount;
|
||||
}
|
||||
} else {
|
||||
|
@ -455,6 +456,20 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of socket pointers for all bindings.
|
||||
*
|
||||
* @return A list of socket pointers for current bindings
|
||||
*/
|
||||
inline std::vector<PhySocket*> getBoundSockets()
|
||||
{
|
||||
std::vector<PhySocket*> sockets;
|
||||
for (int i=0; i<ZT_BINDER_MAX_BINDINGS; i++) {
|
||||
sockets.push_back(_bindings[i].udpSock);
|
||||
}
|
||||
return sockets;
|
||||
}
|
||||
|
||||
private:
|
||||
_Binding _bindings[ZT_BINDER_MAX_BINDINGS];
|
||||
std::atomic<unsigned int> _bindingCount;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue