Codechange: track servers with a ServerAddress instead of a NetworkAddress

This allows future extensions to have different ways of referencing
a server, instead of forcing to use IP:port.
This commit is contained in:
Patric Stout
2021-04-28 14:36:14 +02:00
committed by Patric Stout
parent f4dd2d88c7
commit cee8174d02
6 changed files with 93 additions and 26 deletions

View File

@@ -103,9 +103,14 @@ private:
void Connect(addrinfo *address);
bool CheckActivity();
/* We do not want any other derived classes from this class being able to
* access these private members, but it is okay for TCPServerConnecter. */
friend class TCPServerConnecter;
static void ResolveThunk(TCPConnecter *connecter);
public:
TCPConnecter() {};
TCPConnecter(const std::string &connection_string, uint16 default_port);
virtual ~TCPConnecter();
@@ -124,4 +129,11 @@ public:
static void KillAll();
};
class TCPServerConnecter : public TCPConnecter {
public:
ServerAddress server_address; ///< Address we are connecting to.
TCPServerConnecter(const std::string &connection_string, uint16 default_port);
};
#endif /* NETWORK_CORE_TCP_H */