aboutsummaryrefslogtreecommitdiffstats
path: root/common/network/Socket.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'common/network/Socket.cxx')
-rw-r--r--common/network/Socket.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/common/network/Socket.cxx b/common/network/Socket.cxx
index 8bb96763..879a63d0 100644
--- a/common/network/Socket.cxx
+++ b/common/network/Socket.cxx
@@ -39,6 +39,8 @@
#include <fcntl.h>
#include <errno.h>
+#include <rdr/Exception.h>
+
#include <network/Socket.h>
using namespace network;
@@ -53,7 +55,7 @@ void network::initSockets() {
WSADATA initResult;
if (WSAStartup(requiredVersion, &initResult) != 0)
- throw rdr::SocketException("unable to initialise Winsock2", errorNumber);
+ throw rdr::socket_error("unable to initialise Winsock2", errorNumber);
#else
signal(SIGPIPE, SIG_IGN);
#endif
@@ -161,7 +163,7 @@ Socket* SocketListener::accept() {
// Accept an incoming connection
if ((new_sock = ::accept(fd, nullptr, nullptr)) < 0)
- throw rdr::SocketException("unable to accept new connection", errorNumber);
+ throw rdr::socket_error("unable to accept new connection", errorNumber);
// Create the socket object & check connection is allowed
Socket* s = createSocket(new_sock);
@@ -179,7 +181,7 @@ void SocketListener::listen(int sock)
if (::listen(sock, 5) < 0) {
int e = errorNumber;
closesocket(sock);
- throw rdr::SocketException("unable to set socket to listening mode", e);
+ throw rdr::socket_error("unable to set socket to listening mode", e);
}
fd = sock;