summaryrefslogtreecommitdiff
path: root/src/network/core
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-04-08 23:41:48 +0000
committerrubidium <rubidium@openttd.org>2009-04-08 23:41:48 +0000
commit882e495f5c93512b39764273a61ead8f2954d6b6 (patch)
tree44a7e1a0333681858dd0d92d658d7151c5b7ea3e /src/network/core
parentc2dbc8270be5b423019ea64e68e6b212d713c123 (diff)
downloadopenttd-882e495f5c93512b39764273a61ead8f2954d6b6.tar.xz
(svn r15993) -Codechange: clean up/generalise the handling of the server list
Diffstat (limited to 'src/network/core')
-rw-r--r--src/network/core/address.h15
-rw-r--r--src/network/core/os_abstraction.h4
2 files changed, 4 insertions, 15 deletions
diff --git a/src/network/core/address.h b/src/network/core/address.h
index a51339085..4c025b584 100644
--- a/src/network/core/address.h
+++ b/src/network/core/address.h
@@ -47,21 +47,6 @@ private:
public:
/**
* Create a network address based on a resolved IP and port
- * @param ip the resolved ip
- * @param port the port
- */
- NetworkAddress(in_addr_t ip, uint16 port) :
- address_length(sizeof(sockaddr))
- {
- *this->hostname = '\0';
- memset(&this->address, 0, sizeof(this->address));
- this->address.ss_family = AF_INET;
- ((struct sockaddr_in*)&this->address)->sin_addr.s_addr = ip;
- this->SetPort(port);
- }
-
- /**
- * Create a network address based on a resolved IP and port
* @param address the IP address with port
*/
NetworkAddress(struct sockaddr_storage &address, size_t address_length) :
diff --git a/src/network/core/os_abstraction.h b/src/network/core/os_abstraction.h
index 28c53d91c..1a4bc1691 100644
--- a/src/network/core/os_abstraction.h
+++ b/src/network/core/os_abstraction.h
@@ -289,6 +289,10 @@ static inline bool SetNoDelay(SOCKET d)
#endif
}
+/* Make sure these structures have the size we expect them to be */
+assert_compile(sizeof(in_addr) == 4);
+assert_compile(sizeof(in6_addr) == 16);
+
#endif /* ENABLE_NETWORK */
#endif /* NETWORK_CORE_OS_ABSTRACTION_H */