Comments (3)
You should be able to register a method that has an object as parameter (e.g. "params" : {"dateFrom": x, "dateTo":y}). In your callback, based in the provided data in the Json::Value& request you can figure out what you need to return. In this case your callback acts more like a facade.
from libjson-rpc-cpp.
Yes this should work for the most of the cases (when params object exist). The only problem is if the client will omit params object - according to spec he may do it - and then the client will received exception.
I thinked about something like c++ overloading. Server can register multiple methods with the same name but with different parameter list.
Something like
class AbstarctMyStubServer ...
{
public:
AbstarctMyStubServer(...)
{
}
virtual Json::Value GetLog() = 0;
virtual Json::Value GetLog(const std::string ¶m1 ) = 0;
virtual Json::Value GetLog(const std::string ¶m1, const std::string ¶m1) = 0;
...
};
But the problem is that i don't see this is possible with current lib. (may be i'm wrong).
from libjson-rpc-cpp.
The thing is, that this behavior is not specified in the standard proposal. If you need such things, fork this repo and adapt this as required.
from libjson-rpc-cpp.
Related Issues (20)
- Build fails with libmicrohttpd 0.9.71 HOT 4
- libjson-rpc-cpp 1.3.0 OSX build error with hiredis 1.0.0 HOT 1
- Trying to use the stub generator on Windows HOT 1
- Is there a way to enable IPV6 in tcp server, but not http server HOT 1
- Open-RPC HOT 2
- travis-ci.org no longer exists
- Fix deprecation warnings regarding libjsoncpp Reader()
- Unable to build on windows because of reference to unistd.h HOT 1
- Persistent TCP connection HOT 1
- undefined reference to `jsonrpc::Client::Client(jsonrpc::IClientConnector&, jsonrpc::clientVersion_t, bool)' HOT 4
- is it possible to use two or more .h stubs for one single HTTP server? HOT 1
- Exception -32003 : Client connector error: libcurl error: 60 HOT 2
- Cmake problem HOT 1
- Ubuntu package old HOT 2
- Auth Field Setting HOT 2
- Make file has variables set to not found HOT 2
- Cmake error.. HOT 4
- Potential race condition on socket open/send (discovered on M1)
- Compatibility with catch-3 HOT 5
- httpclient has linker issues
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libjson-rpc-cpp.