summaryrefslogtreecommitdiff
path: root/src/network/core/address.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-04-02 23:59:43 +0000
committerrubidium <rubidium@openttd.org>2009-04-02 23:59:43 +0000
commitc7b6469dabe5018775d075bee0a5293175024b42 (patch)
tree343b43841f480cbd2ab50df10adc949dbd3b954e /src/network/core/address.h
parent521bf687eef36e7c06d09ee610134eb21fed69a9 (diff)
downloadopenttd-c7b6469dabe5018775d075bee0a5293175024b42.tar.xz
(svn r15920) -Codechange: make the (TCP) connecting less AF dependent.
Diffstat (limited to 'src/network/core/address.h')
-rw-r--r--src/network/core/address.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/network/core/address.h b/src/network/core/address.h
index 3a4b8c06e..598cd305e 100644
--- a/src/network/core/address.h
+++ b/src/network/core/address.h
@@ -128,6 +128,11 @@ public:
return this->GetPort() == address.GetPort() && strcmp(this->GetHostname(), address.GetHostname()) == 0;
}
+ /**
+ * Assign another address to ourself
+ * @param other obviously the address to assign to us
+ * @return 'this'
+ */
NetworkAddress& operator = (const NetworkAddress &other)
{
if (this != &other) { // protect against invalid self-assignment
@@ -138,6 +143,11 @@ public:
return *this;
}
+ /**
+ * Connect to the given address.
+ * @return the connected socket or INVALID_SOCKET.
+ */
+ SOCKET Connect();
};
#endif /* ENABLE_NETWORK */