(svn r15993) -Codechange: clean up/generalise the handling of the server list

This commit is contained in:
rubidium
2009-04-08 23:41:48 +00:00
parent e321f5637f
commit be53295ee8
3 changed files with 26 additions and 19 deletions

View File

@@ -45,21 +45,6 @@ private:
*/
SOCKET Resolve(int family, int socktype, int flags, SocketList *sockets, LoopProc func);
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

View File

@@ -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 */