We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://github.com/sogou/srpc
这是搜狗自研的基于Workflow的RPC系统:
#include <stdio.h> #include "example.srpc.h" using namespace srpc; class ExampleServiceImpl : public Example::Service { public: void Echo(EchoRequest *request, EchoResponse *response, RPCContext *ctx) override { response->set_message("Hi, " + request->name()); } }; int main() { SRPCServer server_tcp; SRPCHttpServer server_http; ExampleServiceImpl impl; server_tcp.add_service(&impl); server_http.add_service(&impl); // add the same service impl into two different types of servers server_tcp.start(1412); server_http.start(8811); getchar(); // press "Enter" to end. server_http.stop(); server_tcp.stop(); return 0; }
任何httpclient都可快速访问:
curl 127.0.0.1:8811/Example/Echo -H 'Content-Type: application/json' -d '{message:"from curl",name:"CURL"}'
The text was updated successfully, but these errors were encountered:
No branches or pull requests
项目地址
https://github.com/sogou/srpc
项目描述
这是搜狗自研的基于Workflow的RPC系统:
示例代码
任何httpclient都可快速访问:
The text was updated successfully, but these errors were encountered: