Marek Kotewicz
10 years ago
8 changed files with 102 additions and 65 deletions
@ -0,0 +1,36 @@ |
|||
//
|
|||
// Created by Marek Kotewicz on 04/05/15.
|
|||
//
|
|||
|
|||
#include "JSV8Connector.h" |
|||
|
|||
using namespace std; |
|||
using namespace dev; |
|||
using namespace dev::eth; |
|||
|
|||
bool JSV8Connector::StartListening() |
|||
{ |
|||
return true; |
|||
} |
|||
|
|||
bool JSV8Connector::StopListening() |
|||
{ |
|||
return true; |
|||
} |
|||
|
|||
bool JSV8Connector::SendResponse(std::string const &_response, void *_addInfo) |
|||
{ |
|||
(void)_addInfo; |
|||
m_lastResponse = _response.c_str(); |
|||
return true; |
|||
} |
|||
|
|||
void JSV8Connector::onSend(const char *payload) |
|||
{ |
|||
OnRequest(payload, NULL); |
|||
} |
|||
|
|||
JSV8Connector::~JSV8Connector() |
|||
{ |
|||
StopListening(); |
|||
} |
@ -0,0 +1,30 @@ |
|||
//
|
|||
// Created by Marek Kotewicz on 04/05/15.
|
|||
//
|
|||
|
|||
#pragma once |
|||
|
|||
#include <jsonrpccpp/server/abstractserverconnector.h> |
|||
#include <libjsengine/JSV8RPC.h> |
|||
|
|||
namespace dev |
|||
{ |
|||
namespace eth |
|||
{ |
|||
|
|||
class JSV8Connector : public jsonrpc::AbstractServerConnector, public JSV8RPC |
|||
{ |
|||
|
|||
public: |
|||
JSV8Connector(JSV8Engine const &_engine) : JSV8RPC(_engine) {} |
|||
virtual ~JSV8Connector(); |
|||
|
|||
bool StartListening(); |
|||
bool StopListening(); |
|||
bool SendResponse(std::string const& _response, void* _addInfo = NULL); |
|||
|
|||
void onSend(const char* payload); |
|||
}; |
|||
|
|||
} |
|||
} |
Loading…
Reference in new issue