summaryrefslogtreecommitdiff
path: root/src/IPC.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/IPC.h')
-rw-r--r--src/IPC.h25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/IPC.h b/src/IPC.h
index 97716bb..e0bbcee 100644
--- a/src/IPC.h
+++ b/src/IPC.h
@@ -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;
+};