diff options
Diffstat (limited to 'src/Net/Listener.cpp')
-rw-r--r-- | src/Net/Listener.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Net/Listener.cpp b/src/Net/Listener.cpp index f470896..9233a79 100644 --- a/src/Net/Listener.cpp +++ b/src/Net/Listener.cpp @@ -26,7 +26,7 @@ namespace Mad { namespace Net { -Listener::Listener(const std::string &x905CertFile0, const std::string &x905KeyFile0, const IPAddress &address0) throw(ConnectionException) +Listener::Listener(const std::string &x905CertFile0, const std::string &x905KeyFile0, const IPAddress &address0) throw(Common::Exception) : x905CertFile(x905CertFile0), x905KeyFile(x905KeyFile0), address(address0) { gnutls_dh_params_init(&dh_params); gnutls_dh_params_generate2(dh_params, 768); @@ -34,7 +34,7 @@ Listener::Listener(const std::string &x905CertFile0, const std::string &x905KeyF sock = socket(PF_INET, SOCK_STREAM, 0); if(sock < 0) - throw ConnectionException("socket()", std::strerror(errno)); + throw Common::Exception("socket()", Common::Exception::INTERNAL_ERRNO, errno); // Set non-blocking flag int flags = fcntl(sock, F_GETFL, 0); @@ -42,7 +42,7 @@ Listener::Listener(const std::string &x905CertFile0, const std::string &x905KeyF if(flags < 0) { close(sock); - throw ConnectionException("fcntl()", std::strerror(errno)); + throw Common::Exception("fcntl()", Common::Exception::INTERNAL_ERRNO, errno); } fcntl(sock, F_SETFL, flags | O_NONBLOCK); @@ -54,13 +54,13 @@ Listener::Listener(const std::string &x905CertFile0, const std::string &x905KeyF if(bind(sock, address.getSockAddr(), address.getSockAddrLength()) < 0) { close(sock); - throw ConnectionException("bind()", std::strerror(errno)); + throw Common::Exception("bind()", Common::Exception::INTERNAL_ERRNO, errno); } if(listen(sock, 64) < 0) { close(sock); - throw ConnectionException("listen()", std::strerror(errno)); + throw Common::Exception("listen()", Common::Exception::INTERNAL_ERRNO, errno); } } |