} while (n < 0 && errorNumber == EINTR);
if (n < 0)
- throw SystemException("select", errorNumber);
+ throw SocketException("select", errorNumber);
if (n == 0)
return 0;
} while (n < 0 && errorNumber == EINTR);
if (n < 0)
- throw SystemException("read", errorNumber);
+ throw SocketException("read", errorNumber);
if (n == 0)
throw EndOfStream();
} while (n < 0 && errorNumber == EINTR);
if (n < 0)
- throw SystemException("select", errorNumber);
+ throw SocketException("select", errorNumber);
if (n == 0)
return 0;
} while (n < 0 && (errorNumber == EINTR));
if (n < 0)
- throw SystemException("write", errorNumber);
+ throw SocketException("write", errorNumber);
gettimeofday(&lastWrite, nullptr);
in->readBytes((uint8_t*)data, size);
} catch (EndOfStream&) {
return 0;
- } catch (SystemException &e) {
+ } catch (SocketException& e) {
vlog.error("Failure reading TLS data: %s", e.str());
gnutls_transport_set_errno(self->session, e.err);
- self->saved_exception = new SystemException(e);
+ self->saved_exception = new SocketException(e);
return -1;
} catch (Exception& e) {
vlog.error("Failure reading TLS data: %s", e.str());
try {
out->writeBytes((const uint8_t*)data, size);
out->flush();
- } catch (SystemException &e) {
+ } catch (SocketException& e) {
vlog.error("Failure sending TLS data: %s", e.str());
gnutls_transport_set_errno(self->session, e.err);
- self->saved_exception = new SystemException(e);
+ self->saved_exception = new SocketException(e);
return -1;
} catch (Exception& e) {
vlog.error("Failure sending TLS data: %s", e.str());
FD_ZERO(&rfds);
FD_SET(ConnectionNumber(dpy), &rfds);
int n = select(FD_SETSIZE, &rfds, nullptr, nullptr, nullptr);
- if (n < 0) throw rdr::SystemException("select",errno);
+ if (n < 0) throw rdr::SocketException("select", errno);
}
}
return true;
FD_ZERO(&rfds);
FD_SET(ConnectionNumber(dpy), &rfds);
int n = select(FD_SETSIZE, &rfds, nullptr, nullptr, tvp);
- if (n < 0) throw rdr::SystemException("select",errno);
+ if (n < 0) throw rdr::SocketException("select", errno);
}
XCloseDisplay(dpy);
vlog.debug("Interrupted select() system call");
continue;
} else {
- throw rdr::SystemException("select", errno);
+ throw rdr::SocketException("select", errno);
}
}
vlog.debug("Interrupted select() system call");
continue;
} else {
- throw rdr::SystemException("select", errno);
+ throw rdr::SocketException("select", errno);
}
}
flags |= FD_ADDRESS_LIST_CHANGE;
try {
if (event && (WSAEventSelect(sock_->getFd(), event, flags) == SOCKET_ERROR))
- throw rdr::SystemException("Unable to select on listener", WSAGetLastError());
+ throw rdr::SocketException("Unable to select on listener", WSAGetLastError());
// requestAddressChangeEvents MUST happen after WSAEventSelect, so that the socket is non-blocking
if (acn)
if (j->second.sock->outStream().hasBufferedData())
eventMask |= FD_WRITE;
if (WSAEventSelect(j->second.sock->getFd(), j->first, eventMask) == SOCKET_ERROR)
- throw rdr::SystemException("unable to adjust WSAEventSelect:%u", WSAGetLastError());
+ throw rdr::SocketException("unable to adjust WSAEventSelect:%u", WSAGetLastError());
}
}
// Fetch why this event notification triggered
if (WSAEnumNetworkEvents(ci.sock->getFd(), event, &network_events) == SOCKET_ERROR)
- throw rdr::SystemException("unable to get WSAEnumNetworkEvents:%u", WSAGetLastError());
+ throw rdr::SocketException("unable to get WSAEnumNetworkEvents:%u", WSAGetLastError());
// Cancel event notification for this socket
if (WSAEventSelect(ci.sock->getFd(), event, 0) == SOCKET_ERROR)
- throw rdr::SystemException("unable to disable WSAEventSelect:%u", WSAGetLastError());
+ throw rdr::SocketException("unable to disable WSAEventSelect:%u", WSAGetLastError());
// Reset the event object
WSAResetEvent(event);
if (ci.sock->outStream().hasBufferedData())
eventMask |= FD_WRITE;
if (WSAEventSelect(ci.sock->getFd(), event, eventMask) == SOCKET_ERROR)
- throw rdr::SystemException("unable to re-enable WSAEventSelect:%u", WSAGetLastError());
+ throw rdr::SocketException("unable to re-enable WSAEventSelect:%u", WSAGetLastError());
} catch (rdr::Exception& e) {
vlog.error("%s", e.str());
remSocket(ci.sock);