summaryrefslogtreecommitdiff
path: root/src/network/core/tcp.h
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-04-28 14:36:14 +0200
committerPatric Stout <github@truebrain.nl>2021-07-11 20:38:42 +0200
commitcee8174d02e38542548fc74de93450cfebefaa91 (patch)
tree094ad162d578263d28470a444b3c7656d6bc09ab /src/network/core/tcp.h
parentf4dd2d88c721c085376f59908097500bc5f0c143 (diff)
downloadopenttd-cee8174d02e38542548fc74de93450cfebefaa91.tar.xz
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.
Diffstat (limited to 'src/network/core/tcp.h')
-rw-r--r--src/network/core/tcp.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/network/core/tcp.h b/src/network/core/tcp.h
index 3b217cb2e..379ef8b92 100644
--- a/src/network/core/tcp.h
+++ b/src/network/core/tcp.h
@@ -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 */