summaryrefslogtreecommitdiffstats
path: root/src/Net/IPAddress.cpp
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-05-06 17:39:30 +0200
committerMatthias Schiffer <matthias@gamezock.de>2009-05-06 17:39:30 +0200
commit8324b947487f72fd8cfc439ea5ae5bd1187fff1b (patch)
treee7fb69f3207654b5e3d4ba260d3f51082b1d399a /src/Net/IPAddress.cpp
parent5bf3e2229015d93808bb0c2f4729c2c4f4da414e (diff)
downloadmad-8324b947487f72fd8cfc439ea5ae5bd1187fff1b.tar
mad-8324b947487f72fd8cfc439ea5ae5bd1187fff1b.zip
Exception und ThreadHandler nach Net verschoben
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 6bf79a3..eb9d3be 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(Common::Exception) {
+IPAddress::IPAddress(const std::string &address) throw(Exception) {
std::string ip;
size_t pos = address.find_first_of(':');
@@ -51,7 +51,7 @@ IPAddress::IPAddress(const std::string &address) throw(Common::Exception) {
char *endptr;
port = std::strtol(address.substr(pos+1).c_str(), &endptr, 10);
if(*endptr != 0 || port == 0)
- throw Common::Exception(Common::Exception::INVALID_ADDRESS);
+ throw Exception(Exception::INVALID_ADDRESS);
}
sa.sin_family = AF_INET;
@@ -60,17 +60,17 @@ IPAddress::IPAddress(const std::string &address) throw(Common::Exception) {
if(ip == "*")
sa.sin_addr.s_addr = INADDR_ANY;
else if(!inet_pton(AF_INET, ip.c_str(), &sa.sin_addr))
- throw Common::Exception(Common::Exception::INVALID_ADDRESS);
+ throw Exception(Exception::INVALID_ADDRESS);
addr = ntohl(sa.sin_addr.s_addr);
}
-IPAddress::IPAddress(const std::string &address, uint16_t port0) throw(Common::Exception) : port(port0) {
+IPAddress::IPAddress(const std::string &address, uint16_t port0) throw(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 Common::Exception(Common::Exception::INVALID_ADDRESS);
+ throw Exception(Exception::INVALID_ADDRESS);
addr = ntohl(sa.sin_addr.s_addr);
}