Support client round robin to multiple server addresses.

Change-Id: If87dc64a485b1c8a340c5f6fa39ca09d40133e30
This commit is contained in:
Peter Johnson
2016-04-08 13:31:35 -07:00
parent b8ad1de33c
commit 5ac68f74d4
12 changed files with 175 additions and 25 deletions

View File

@@ -26,7 +26,7 @@ class NetworkTable : public ITable {
typedef std::pair<ITableListener*, unsigned int> Listener;
std::vector<Listener> m_listeners;
static std::string s_ip_address;
static std::vector<std::string> s_ip_addresses;
static std::string s_persistent_filename;
static bool s_client;
static bool s_running;
@@ -74,6 +74,12 @@ class NetworkTable : public ITable {
*/
static void SetIPAddress(llvm::StringRef address);
/**
* @param addresses the addresses that network tables will connect to in
* client mode (in round robin order)
*/
static void SetIPAddress(llvm::ArrayRef<std::string> addresses);
/**
* @param port the port number that network tables will connect to in client
* mode or listen to in server mode