aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/network/Socket.cxx6
-rw-r--r--common/network/Socket.h5
-rw-r--r--common/rdr/Exception.h4
3 files changed, 7 insertions, 8 deletions
diff --git a/common/network/Socket.cxx b/common/network/Socket.cxx
index 8da44366..8bb96763 100644
--- a/common/network/Socket.cxx
+++ b/common/network/Socket.cxx
@@ -53,7 +53,7 @@ void network::initSockets() {
WSADATA initResult;
if (WSAStartup(requiredVersion, &initResult) != 0)
- throw SocketException("unable to initialise Winsock2", errorNumber);
+ throw rdr::SocketException("unable to initialise Winsock2", errorNumber);
#else
signal(SIGPIPE, SIG_IGN);
#endif
@@ -161,7 +161,7 @@ Socket* SocketListener::accept() {
// Accept an incoming connection
if ((new_sock = ::accept(fd, nullptr, nullptr)) < 0)
- throw SocketException("unable to accept new connection", errorNumber);
+ throw rdr::SocketException("unable to accept new connection", errorNumber);
// Create the socket object & check connection is allowed
Socket* s = createSocket(new_sock);
@@ -179,7 +179,7 @@ void SocketListener::listen(int sock)
if (::listen(sock, 5) < 0) {
int e = errorNumber;
closesocket(sock);
- throw SocketException("unable to set socket to listening mode", e);
+ throw rdr::SocketException("unable to set socket to listening mode", e);
}
fd = sock;
diff --git a/common/network/Socket.h b/common/network/Socket.h
index 7085d73a..34b8db8e 100644
--- a/common/network/Socket.h
+++ b/common/network/Socket.h
@@ -26,7 +26,6 @@
#include <limits.h>
#include <rdr/FdInStream.h>
#include <rdr/FdOutStream.h>
-#include <rdr/Exception.h>
namespace network {
@@ -107,10 +106,6 @@ namespace network {
ConnectionFilter* filter;
};
- struct SocketException : public rdr::SystemException {
- SocketException(const char* text, int err_) : rdr::SystemException(text, err_) {}
- };
-
}
#endif // __NETWORK_SOCKET_H__
diff --git a/common/rdr/Exception.h b/common/rdr/Exception.h
index f1a167e5..1202c37c 100644
--- a/common/rdr/Exception.h
+++ b/common/rdr/Exception.h
@@ -37,6 +37,10 @@ namespace rdr {
SystemException(const char* s, int err_);
};
+ struct SocketException : public SystemException {
+ SocketException(const char* text, int err_) : SystemException(text, err_) {}
+ };
+
struct GAIException : public Exception {
int err;
GAIException(const char* s, int err_);