diff options
Diffstat (limited to 'src/IPC.h')
| -rw-r--r-- | src/IPC.h | 25 |
1 files changed, 23 insertions, 2 deletions
@@ -7,10 +7,10 @@ #include "config.h" #include "util.h" -class IPCModule +class IPCServerModule { public: - IPCModule(CommandsModule& commandsModule, Config& cfg, Globals& globals); + IPCServerModule(CommandsModule& commandsModule, Config& cfg, Globals& globals); void init(); void doListen(); void quitIPC(); @@ -25,3 +25,24 @@ private: bool ready = false; sockaddr_un address; }; + +class IPCClientModule +{ +public: + IPCClientModule(); + + // Returns 0 for success, 1 for X error, -1 for socket error + int init(); + + // Returns 0 for success, 1 for not ready, -1 for socket error + int sendMessage(const char* message, int length); + + // Returns 0 for success, 1 for not ready, -1 for socket error + int getMessage(char* buff, int buffsize); + + + void quit(); +private: + bool ready; + int sockfd; +}; |
