aboutsummaryrefslogtreecommitdiffstats
path: root/common/network/Socket.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2024-11-07 10:37:53 +0100
committerPierre Ossman <ossman@cendio.se>2024-11-07 10:37:53 +0100
commitf7507aea98b1a428d02fe5c41d25ee69dd5436bb (patch)
tree49f9349a1d7441874d1cb6d4428e2bcb0d63b422 /common/network/Socket.cxx
parent7508e9887de022e127d8fadb9f6a6bd8e9778864 (diff)
parent2b7857283b834391266e414adcff8c20f8fe3067 (diff)
downloadtigervnc-f7507aea98b1a428d02fe5c41d25ee69dd5436bb.tar.gz
tigervnc-f7507aea98b1a428d02fe5c41d25ee69dd5436bb.zip
Merge branch 'stdexcept' of github.com:CendioOssman/tigervnc
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;