summaryrefslogtreecommitdiff
path: root/node/IpcConnection.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2014-03-18 18:44:44 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2014-03-18 18:44:44 -0700
commit3be4c38946ddd38134f2093bc55950d45b1d1a6c (patch)
treeef3ce97a6bef43b6871b730f11567026dacf8736 /node/IpcConnection.hpp
parent6a1bd52854afebf2547033f91b123dd512e11d1b (diff)
downloadinfinitytier-3be4c38946ddd38134f2093bc55950d45b1d1a6c.tar.gz
infinitytier-3be4c38946ddd38134f2093bc55950d45b1d1a6c.zip
IPC stuff for Unix.
Diffstat (limited to 'node/IpcConnection.hpp')
-rw-r--r--node/IpcConnection.hpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/node/IpcConnection.hpp b/node/IpcConnection.hpp
index 0636196a..60d34634 100644
--- a/node/IpcConnection.hpp
+++ b/node/IpcConnection.hpp
@@ -48,19 +48,34 @@ class IpcConnection : NonCopyable
friend class SharedPtr<IpcConnection>;
public:
- IpcConnection(const char *endpoint);
+ /**
+ * Connect to an IPC endpoint
+ *
+ * @param endpoint Endpoint path
+ * @param commandHandler Command handler function
+ * @param arg First argument to command handler
+ * @throws std::runtime_error Unable to connect
+ */
+ IpcConnection(const char *endpoint,void (*commandHandler)(void *,const SharedPtr<IpcConnection> &,const char *),void *arg);
~IpcConnection();
- void writeln(const char *format,...);
+ /**
+ * @param format Printf format string
+ * @param ... Printf arguments
+ */
+ void printf(const char *format,...);
+ /**
+ * Close this connection
+ */
void close();
void threadMain()
throw();
private:
- // Used by IpcListener to construct connections from incoming attempts
- IpcConnection(int s);
+ // Used by IpcListener to construct incoming connections
+ IpcConnection(int s,void (*commandHandler)(void *,const SharedPtr<IpcConnection> &,const char *),void *arg);
void (*_handler)(void *,const SharedPtr<IpcConnection> &,const char *);
void *_arg;