Browse Source
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@57 1a98c847-1fd6-4fd8-948a-caf3550aa51bmiguelfreitas
s_nakamoto
15 years ago
7 changed files with 8 additions and 101 deletions
@ -1,33 +0,0 @@ |
|||||||
/*
|
|
||||||
* 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; |
|
||||||
} |
|
@ -1,28 +0,0 @@ |
|||||||
#ifndef _IPC_H |
|
||||||
#define _IPC_H |
|
||||||
|
|
||||||
class CServer : public wxServer { |
|
||||||
public: |
|
||||||
wxConnectionBase * OnAcceptConnection (const wxString &topic); |
|
||||||
}; |
|
||||||
|
|
||||||
class CClient : public wxClient { |
|
||||||
public: |
|
||||||
wxConnectionBase * OnMakeConnection (); |
|
||||||
}; |
|
||||||
|
|
||||||
class CServerConnection : public wxConnection { |
|
||||||
public: |
|
||||||
const void * OnRequest (const wxString &topic, const wxString &item, size_t *size, wxIPCFormat format); |
|
||||||
}; |
|
||||||
|
|
||||||
class CClientConnection : public wxConnection { |
|
||||||
public: |
|
||||||
CClientConnection() : wxConnection() {} |
|
||||||
~CClientConnection() {} |
|
||||||
|
|
||||||
bool OnAdvise (const wxString &topic, const wxString &item, const void *data, size_t size, wxIPCFormat format); |
|
||||||
}; |
|
||||||
|
|
||||||
#endif /* _IPC_H */ |
|
||||||
|
|
Loading…
Reference in new issue