diff options
author | Patric Stout <truebrain@openttd.org> | 2021-04-27 11:51:00 +0200 |
---|---|---|
committer | Patric Stout <github@truebrain.nl> | 2021-07-16 19:50:29 +0200 |
commit | 8adade26ed0354e5357803cf19ea9839c2eb785c (patch) | |
tree | 08c73e20a16ea19ee1545de8df6c4b1095c08707 /src/network/core/tcp.h | |
parent | 55eed246b842d372cd32784c1afcc904aef67f65 (diff) | |
download | openttd-8adade26ed0354e5357803cf19ea9839c2eb785c.tar.xz |
Feature: allow the use of STUN to connect client and server together
This method doesn't require port-forwarding to be used, and works for
most common NAT routers in home setups. But, for sure it doesn't work
for all setups, and not everyone will be able to use this.
Diffstat (limited to 'src/network/core/tcp.h')
-rw-r--r-- | src/network/core/tcp.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/network/core/tcp.h b/src/network/core/tcp.h index b4b4398de..52d9cfddb 100644 --- a/src/network/core/tcp.h +++ b/src/network/core/tcp.h @@ -99,6 +99,7 @@ private: std::string connection_string; ///< Current address we are connecting to (before resolving). NetworkAddress bind_address; ///< Address we're binding to, if any. + int family = AF_UNSPEC; ///< Family we are using to connect with. void Resolve(); void OnResolved(addrinfo *ai); @@ -114,7 +115,7 @@ private: public: TCPConnecter() {}; - TCPConnecter(const std::string &connection_string, uint16 default_port, NetworkAddress bind_address = {}); + TCPConnecter(const std::string &connection_string, uint16 default_port, NetworkAddress bind_address = {}, int family = AF_UNSPEC); virtual ~TCPConnecter(); /** |