Changeset 9426 in orxonox.OLD for branches/proxy/src/lib/network/ip.cc
- Timestamp:
- Jul 24, 2006, 2:49:33 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/ip.cc
r9406 r9426 185 185 IPaddress ipaddr; 186 186 187 SDLNet_ResolveHost(&ipaddr, NULL, 2000);188 189 return IP(ipaddr .host, port);187 SDLNet_ResolveHost(&ipaddr, ip.c_str(), port); 188 189 return IP(ipaddr); 190 190 } 191 191 else … … 255 255 /** 256 256 * @brief converts a IP into a String (without port). 257 * @param ipthe IP to put into the string.257 * @param host the IP to put into the string. 258 258 * @param port -1 if not wanted 259 259 * @return the string of the ip. 260 260 */ 261 std::string IP::ipToString(int ip, int port)262 { 263 MultiType part0((int) ( ip & 0xFF000000) >> 24);264 MultiType part1((int) ( ip & 0x00FF0000) >> 16);265 MultiType part2((int) ( ip & 0x0000FF00) >> 8);266 MultiType part3((int) ( ip & 0x000000FF));261 std::string IP::ipToString(int host, int port) 262 { 263 MultiType part0((int) ((host & 0xFF000000) >> 24)); 264 MultiType part1((int) ((host & 0x00FF0000) >> 16)); 265 MultiType part2((int) ((host & 0x0000FF00) >> 8)); 266 MultiType part3((int) ((host & 0x000000FF) )); 267 267 268 268 std::string addr = part3.getString() + "." + part2.getString() + "." +
Note: See TracChangeset
for help on using the changeset viewer.