From 3be4c38946ddd38134f2093bc55950d45b1d1a6c Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 18 Mar 2014 18:44:44 -0700 Subject: IPC stuff for Unix. --- node/IpcConnection.hpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'node/IpcConnection.hpp') 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; 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 &,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 &,const char *),void *arg); void (*_handler)(void *,const SharedPtr &,const char *); void *_arg; -- cgit v1.2.3