diff options
Diffstat (limited to 'unix/x0vncserver')
-rw-r--r-- | unix/x0vncserver/XDesktop.cxx | 6 | ||||
-rw-r--r-- | unix/x0vncserver/XDesktop.h | 1 | ||||
-rw-r--r-- | unix/x0vncserver/x0vncserver.cxx | 4 |
3 files changed, 9 insertions, 2 deletions
diff --git a/unix/x0vncserver/XDesktop.cxx b/unix/x0vncserver/XDesktop.cxx index 5f71ccb2..1fdc9e2c 100644 --- a/unix/x0vncserver/XDesktop.cxx +++ b/unix/x0vncserver/XDesktop.cxx @@ -19,6 +19,8 @@ */ #include <assert.h> +#include <signal.h> +#include <unistd.h> #include <rfb/LogWriter.h> @@ -273,6 +275,10 @@ void XDesktop::stop() { pb = 0; } +void XDesktop::terminate() { + kill(getpid(), SIGTERM); +} + bool XDesktop::isRunning() { return running; } diff --git a/unix/x0vncserver/XDesktop.h b/unix/x0vncserver/XDesktop.h index 7d060613..3e85aac3 100644 --- a/unix/x0vncserver/XDesktop.h +++ b/unix/x0vncserver/XDesktop.h @@ -49,6 +49,7 @@ public: // -=- SDesktop interface virtual void start(rfb::VNCServer* vs); virtual void stop(); + virtual void terminate(); bool isRunning(); virtual void queryConnection(network::Socket* sock, const char* userName); diff --git a/unix/x0vncserver/x0vncserver.cxx b/unix/x0vncserver/x0vncserver.cxx index c77870de..cf2c35a2 100644 --- a/unix/x0vncserver/x0vncserver.cxx +++ b/unix/x0vncserver/x0vncserver.cxx @@ -322,7 +322,7 @@ int main(int argc, char** argv) } } - soonestTimeout(&wait_ms, server.checkTimeouts()); + soonestTimeout(&wait_ms, Timer::checkTimeouts()); tv.tv_sec = wait_ms / 1000; tv.tv_usec = (wait_ms % 1000) * 1000; @@ -357,7 +357,7 @@ int main(int argc, char** argv) } } - server.checkTimeouts(); + Timer::checkTimeouts(); // Client list could have been changed. server.getSockets(&sockets); |