Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9426 in orxonox.OLD for branches/proxy/src/lib/network/ip.cc


Ignore:
Timestamp:
Jul 24, 2006, 2:49:33 PM (18 years ago)
Author:
bensch
Message:

cleaner ip inclusion

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/lib/network/ip.cc

    r9406 r9426  
    185185    IPaddress ipaddr;
    186186
    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);
    190190  }
    191191  else
     
    255255/**
    256256 * @brief converts a IP into a String (without port).
    257  * @param ip the IP to put into the string.
     257 * @param host the IP to put into the string.
    258258 * @param port -1 if not wanted
    259259 * @return the string of the ip.
    260260 */
    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) );
     261std::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) ));
    267267
    268268  std::string addr = part3.getString() + "." + part2.getString() + "." +
Note: See TracChangeset for help on using the changeset viewer.