summaryrefslogtreecommitdiffstats
path: root/src/Net/IPAddress.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Net/IPAddress.cpp')
-rw-r--r--src/Net/IPAddress.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Net/IPAddress.cpp b/src/Net/IPAddress.cpp
index 9c9793e..6bf79a3 100644
--- a/src/Net/IPAddress.cpp
+++ b/src/Net/IPAddress.cpp
@@ -36,7 +36,7 @@ IPAddress::IPAddress(uint32_t address, uint16_t port0) : addr(address), port(por
sa.sin_addr.s_addr = htonl(addr);
}
-IPAddress::IPAddress(const std::string &address) throw(InvalidAddressException) {
+IPAddress::IPAddress(const std::string &address) throw(Common::Exception) {
std::string ip;
size_t pos = address.find_first_of(':');
@@ -51,7 +51,7 @@ IPAddress::IPAddress(const std::string &address) throw(InvalidAddressException)
char *endptr;
port = std::strtol(address.substr(pos+1).c_str(), &endptr, 10);
if(*endptr != 0 || port == 0)
- throw InvalidAddressException(address);
+ throw Common::Exception(Common::Exception::INVALID_ADDRESS);
}
sa.sin_family = AF_INET;
@@ -60,17 +60,17 @@ IPAddress::IPAddress(const std::string &address) throw(InvalidAddressException)
if(ip == "*")
sa.sin_addr.s_addr = INADDR_ANY;
else if(!inet_pton(AF_INET, ip.c_str(), &sa.sin_addr))
- throw InvalidAddressException(address);
+ throw Common::Exception(Common::Exception::INVALID_ADDRESS);
addr = ntohl(sa.sin_addr.s_addr);
}
-IPAddress::IPAddress(const std::string &address, uint16_t port0) throw(InvalidAddressException) : port(port0) {
+IPAddress::IPAddress(const std::string &address, uint16_t port0) throw(Common::Exception) : port(port0) {
sa.sin_family = AF_INET;
sa.sin_port = htons(port);
if(!inet_pton(AF_INET, address.c_str(), &sa.sin_addr))
- throw InvalidAddressException(address);
+ throw Common::Exception(Common::Exception::INVALID_ADDRESS);
addr = ntohl(sa.sin_addr.s_addr);
}