aboutsummaryrefslogtreecommitdiff
path: root/ipc.cpp
diff options
context:
space:
mode:
authorsirius-m <sirius-m@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-02-04 15:31:46 +0000
committersirius-m <sirius-m@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-02-04 15:31:46 +0000
commita43c00c56944ca69dcf319cd85754dc0fb1f2260 (patch)
tree17f221a28133394f5a0cd0931ceadf0eaa463cb4 /ipc.cpp
parentupdate fSpent flag on wallet transactions if they're seen spent in case copy ... (diff)
downloaddiscoin-a43c00c56944ca69dcf319cd85754dc0fb1f2260.tar.xz
discoin-a43c00c56944ca69dcf319cd85754dc0fb1f2260.zip
Added some basic IPC functionality using wxServer, wxClient and wxConnection.
Added the -blockamount command line option for an example of usage.
Diffstat (limited to 'ipc.cpp')
-rw-r--r--ipc.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/ipc.cpp b/ipc.cpp
new file mode 100644
index 000000000..86e57674e
--- /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