diff options
author | sirius-m <sirius-m@1a98c847-1fd6-4fd8-948a-caf3550aa51b> | 2010-02-04 15:31:46 +0000 |
---|---|---|
committer | sirius-m <sirius-m@1a98c847-1fd6-4fd8-948a-caf3550aa51b> | 2010-02-04 15:31:46 +0000 |
commit | 082e725b33addda32ec4b31eba60b47f0dc6879f (patch) | |
tree | 17f221a28133394f5a0cd0931ceadf0eaa463cb4 /ipc.cpp | |
parent | 53d508072b02d522371bde148dcc3e925f472be7 (diff) | |
download | bitcoin-082e725b33addda32ec4b31eba60b47f0dc6879f.tar.xz |
Added some basic IPC functionality using wxServer, wxClient and wxConnection.
Added the -blockamount command line option for an example of usage.
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@56 1a98c847-1fd6-4fd8-948a-caf3550aa51b
Diffstat (limited to 'ipc.cpp')
-rw-r--r-- | ipc.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/ipc.cpp b/ipc.cpp new file mode 100644 index 0000000000..86e57674e2 --- /dev/null +++ b/ipc.cpp @@ -0,0 +1,33 @@ +/* + * Inter-process calling functionality + */ + +#include "headers.h" + +wxConnectionBase * CServer::OnAcceptConnection (const wxString &topic) { + return new CServerConnection; +} + +wxConnectionBase * CClient::OnMakeConnection () { + return new CClientConnection; +} + +// For request based handling +const void * CServerConnection::OnRequest (const wxString &topic, const wxString &item, size_t *size, wxIPCFormat format) { + const char * output; + + if (item == "blockamount") { + stringstream stream; + stream << nBestHeight + 1; + output = stream.str().c_str(); + } + else + output = "Unknown identifier"; + + return output; +} + +// For event based handling +bool CClientConnection::OnAdvise (const wxString &topic, const wxString &item, const void *data, size_t size, wxIPCFormat format) { + return false; +}
\ No newline at end of file |