diff options
author | Gyuhwan Park★ <unstabler@unstabler.pl> | 2023-02-02 17:24:11 +0300 |
---|---|---|
committer | Gyuhwan Park★ <unstabler@unstabler.pl> | 2023-02-02 17:24:11 +0300 |
commit | 18701d80d5590748d6a27561e7d90e0e7a7a1534 (patch) | |
tree | 9a1277e8530cdfc21fd8a3b322d57051ee5cbcb7 | |
parent | 47d6b37bbfc7f05d8d5a07c4f065b9c0f64817fc (diff) |
fix: implement lib_mod_get_wait_objs(), this may resolve #3 partially
-rw-r--r-- | IPCConnection.cpp | 4 | ||||
-rw-r--r-- | IPCConnection.hpp | 2 | ||||
-rw-r--r-- | ProjectorClient.cpp | 4 | ||||
-rw-r--r-- | ProjectorClient.hpp | 5 | ||||
-rw-r--r-- | XrdpUlalacaPrivate.xrdpmodule.cpp | 9 |
5 files changed, 23 insertions, 1 deletions
diff --git a/IPCConnection.cpp b/IPCConnection.cpp index cf9e21c..c23fd36 100644 --- a/IPCConnection.cpp +++ b/IPCConnection.cpp @@ -28,6 +28,10 @@ IPCConnection::IPCConnection(std::string socketPath): } +FD IPCConnection::descriptor() { + return _socket.descriptor(); +} + void IPCConnection::connect() { _socket.connect(); diff --git a/IPCConnection.hpp b/IPCConnection.hpp index 82ad068..10d0553 100644 --- a/IPCConnection.hpp +++ b/IPCConnection.hpp @@ -23,6 +23,8 @@ public: explicit IPCConnection(std::string socketPath); IPCConnection(IPCConnection &) = delete; + + FD descriptor(); /** * @throws SystemCallException diff --git a/ProjectorClient.cpp b/ProjectorClient.cpp index adf31d8..c57e87e 100644 --- a/ProjectorClient.cpp +++ b/ProjectorClient.cpp @@ -29,6 +29,10 @@ ProjectorClient::ProjectorClient( } +FD ProjectorClient::descriptor() { + return _ipcConnection.descriptor(); +} + void ProjectorClient::start() { _ipcConnection.connect(); _projectorThread = std::thread(&ProjectorClient::mainLoop, this); diff --git a/ProjectorClient.hpp b/ProjectorClient.hpp index 97c9497..7191533 100644 --- a/ProjectorClient.hpp +++ b/ProjectorClient.hpp @@ -25,7 +25,9 @@ public: const std::string &socketPath ); ProjectorClient(ProjectorClient &) = delete; - + + FD descriptor(); + void start(); void stop(); @@ -33,6 +35,7 @@ public: void setViewport(ULIPCRect rect); void setOutputSuppression(bool isOutputSuppressed); + private: void mainLoop(); diff --git a/XrdpUlalacaPrivate.xrdpmodule.cpp b/XrdpUlalacaPrivate.xrdpmodule.cpp index 556142a..654cc4a 100644 --- a/XrdpUlalacaPrivate.xrdpmodule.cpp +++ b/XrdpUlalacaPrivate.xrdpmodule.cpp @@ -113,10 +113,19 @@ int XrdpUlalacaPrivate::libModSessionChange(int, int) { } int XrdpUlalacaPrivate::libModGetWaitObjs(tbus *readObjs, int *rcount, tbus *writeObjs, int *wcount, int *timeout) { + // FIXME + if (!_isUpdateThreadRunning) { + return 0; + } + + readObjs[(*rcount)++] = _projectorClient->descriptor(); + writeObjs[(*wcount)++] = _projectorClient->descriptor(); + return 0; } int XrdpUlalacaPrivate::libModCheckWaitObjs() { + // TODO: move ipcConnection.read()/write() to here..? return 0; } |