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
// 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);
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;
#include <limits.h>
#include <rdr/FdInStream.h>
#include <rdr/FdOutStream.h>
-#include <rdr/Exception.h>
namespace network {
ConnectionFilter* filter;
};
- struct SocketException : public rdr::SystemException {
- SocketException(const char* text, int err_) : rdr::SystemException(text, err_) {}
- };
-
}
#endif // __NETWORK_SOCKET_H__
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_);