mirror of https://github.com/OpenTTD/OpenTTD
Codechange: move connection_string to private for TCPConnecter
The most common case never needs access to it anymore. Make the one exception to this explicit. This means the fact that we store it is now an implementation detail.pull/9217/head
parent
de940b1dbc
commit
664a8c3e85
|
@ -74,6 +74,7 @@ private:
|
||||||
std::chrono::steady_clock::time_point last_attempt; ///< Time we last tried to connect.
|
std::chrono::steady_clock::time_point last_attempt; ///< Time we last tried to connect.
|
||||||
|
|
||||||
std::atomic<bool> is_resolved = false; ///< Whether resolving is done.
|
std::atomic<bool> is_resolved = false; ///< Whether resolving is done.
|
||||||
|
std::string connection_string; ///< Current address we are connecting to (before resolving).
|
||||||
|
|
||||||
void Resolve();
|
void Resolve();
|
||||||
void OnResolved(addrinfo *ai);
|
void OnResolved(addrinfo *ai);
|
||||||
|
@ -84,8 +85,6 @@ private:
|
||||||
static void ResolveThunk(TCPConnecter *connecter);
|
static void ResolveThunk(TCPConnecter *connecter);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
std::string connection_string; ///< Current address we are connecting to (before resolving).
|
|
||||||
|
|
||||||
TCPConnecter(const std::string &connection_string, uint16 default_port);
|
TCPConnecter(const std::string &connection_string, uint16 default_port);
|
||||||
virtual ~TCPConnecter();
|
virtual ~TCPConnecter();
|
||||||
|
|
||||||
|
|
|
@ -1145,8 +1145,11 @@ static void NetworkGenerateServerId()
|
||||||
}
|
}
|
||||||
|
|
||||||
class TCPNetworkDebugConnecter : TCPConnecter {
|
class TCPNetworkDebugConnecter : TCPConnecter {
|
||||||
|
private:
|
||||||
|
std::string connection_string;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TCPNetworkDebugConnecter(const std::string &connection_string) : TCPConnecter(connection_string, NETWORK_DEFAULT_DEBUGLOG_PORT) {}
|
TCPNetworkDebugConnecter(const std::string &connection_string) : TCPConnecter(connection_string, NETWORK_DEFAULT_DEBUGLOG_PORT), connection_string(connection_string) {}
|
||||||
|
|
||||||
void OnFailure() override
|
void OnFailure() override
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue