+IPAddr::IPAddr(const std::string& ip) throw (std::logic_error)
+{
+ std::istringstream iss(ip);
+ std::string ips;
+ for (int i = 0; i < 4; ++i)
+ {
+ if (!std::getline(iss, ips, '.'))
+ throw std::logic_error("Dirección IP inválida");
+ atoms[i] = std::atoi(ips.c_str());
+ }
+}