# buttonrpc - a simple rpc framework for C++
- ZeroMQ as the network layer.
- c++14版本 [https://github.com/button-chen/buttonrpc_cpp14](https://github.com/button-chen/buttonrpc_cpp14)
## Features
- 轻量级,跨平台,简单易用
- 服务端可以绑定自由函数,类成员函数,std::function对象
- 服务端可以绑定参数是任意自定义类型的函数
- 客户端与服务端自动重连机制
- 客户端调用超时选项
## Example
server:
```c++
#include "buttonrpc.hpp"
int foo(int age, int mm){
return age + mm;
}
int main()
{
buttonrpc server;
server.as_server(5555);
server.bind("foo", foo);
server.run();
return 0;
}
```
client:
```c++
#include <iostream>
#include "buttonrpc.hpp"
int main()
{
buttonrpc client;
client.as_client("127.0.0.1", 5555);
int a = client.call<int>("foo", 2, 3).val();
std::cout << "call foo result: " << a << std::endl;
system("pause");
return 0;
}
// output: call foo result: 5
```
## Dependences
- [ZeroMQ](http://zguide.zeromq.org/page:all)
## Building
- vs2010 或者更高版本 (为了兼容vs2010没有用到可变模板参数)
- gcc/g++ 支持部分c++11特性即可
## Usage
- 1: 更多例子在目录 example/ 下
- 2: 最多支持5个参数的函数,支持任意多个参数函数请使用c++14版本:
[https://github.com/button-chen/buttonrpc_cpp14](https://github.com/button-chen/buttonrpc_cpp14)
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
MIT6.824分布式系统的C++版本实现,能学到分布式系统设计、rpc使用、mapreduce、基本数据库设计、raft算法、分布式一致性等后端知识点,结合了linux系统的许多系统调用 软件开发设计:应用软件开发、系统软件开发、移动应用开发、网站开发C++、Java、python、web、C#等语言的项目开发与学习资料 硬件与设备:单片机、EDA、proteus、RTOS、包括计算机硬件、服务器、网络设备、存储设备、移动设备等 操作系统:LInux、树莓派、安卓开发、微机操作系统、网络操作系统、分布式操作系统等。此外,还有嵌入式操作系统、智能操作系统等。 网络与通信:数据传输、信号处理、网络协议、网络与通信硬件、网络安全网络与通信是一个非常广泛的领域,它涉及到计算机科学、电子工程、数学等多个学科的知识。 云计算与大数据:包括云计算平台、大数据分析、人工智能、机器学习等,云计算是一种基于互联网的计算方式,通过这种方式,共享的软硬件资源和信息可以按需提供给计算机和其他设备
资源推荐
资源详情
资源评论
收起资源包目录
MIT6.824分布式系统的C++版本实现,能学到分布式系统设计、rpc使用、mapreduce、基本数据库设计、raft算法、分布式一致性等后端知识点,结合了linux系统的许多系统调用.zip (98个子文件)
cm
LAB3B.md 5KB
LAB2C.md 2KB
src
MapReduce
pg-huckleberry_finn.txt 580KB
pg-tom_sawyer.txt 403KB
makefile 175B
pg-sherlock_holmes.txt 568KB
mr-out-2 25KB
.vscode
settings.json 1KB
master.cpp 9KB
worker 238KB
pg-being_ernest.txt 136KB
locker.h 999B
mr-out-5 25KB
mr-out-6 25KB
map_reduceFun.cpp 2KB
pg-frankenstein.txt 431KB
map_reduceFun.o 95KB
buttonrpc-master
depends
zmq.h 14KB
zmq.hpp 29KB
buttonrpc.hpp 14KB
example
main_server.cpp 2KB
cli 120KB
ser 330KB
main_client.cpp 2KB
README.md 1KB
Serializer.hpp 3KB
pg-grimm.txt 528KB
mr-out-1 25KB
pg-metamorphosis.txt 136KB
libmrFunc.so 75KB
master 399KB
mr-out-4 24KB
mr-out-0 26KB
mr-out-3 25KB
编译.txt 162B
pg-dorian_gray.txt 443KB
worker.cpp 13KB
mr-out-8 24KB
mr-out-7 25KB
shardKv
remove.sh 316B
.vscode
settings.json 290B
shardmaster
remove.sh 313B
raft.hpp 41KB
locker.h 2KB
shardClerk.hpp 8KB
buttonrpc-master
depends
zmq.h 14KB
zmq.hpp 29KB
buttonrpc.hpp 14KB
example
main_server.cpp 2KB
main_client.cpp 2KB
README.md 1KB
Serializer.hpp 3KB
test.hpp 6KB
shardMaster.hpp 19KB
common.h 6KB
cli 1.54MB
ser 831KB
server.cpp 450B
client.cpp 2KB
myClass.h 4KB
test.cpp 15KB
cli 1.77MB
ser 3.23MB
server.cpp 43KB
client.cpp 9KB
kvRaft
remove.sh 313B
raft.hpp 44KB
locker.h 2KB
buttonrpc-master
depends
zmq.h 14KB
zmq.hpp 29KB
buttonrpc.hpp 14KB
example
main_server.cpp 2KB
main_client.cpp 2KB
README.md 1KB
Serializer.hpp 3KB
select.h 2KB
log.txt 242KB
cli 436KB
ser 1.82MB
server.cpp 18KB
client.cpp 7KB
Raft
locker.h 2KB
buttonrpc-master
depends
zmq.h 14KB
zmq.hpp 29KB
buttonrpc.hpp 14KB
example
main_server.cpp 2KB
main_client.cpp 2KB
README.md 1KB
Serializer.hpp 3KB
raft 336KB
raft.cpp 27KB
LAB1.md 10KB
LAB3A.md 13KB
LAB2A.md 16KB
LAB4A.md 18KB
README.md 906B
LAB4B.md 20KB
LAB2B.md 7KB
共 98 条
- 1
资源评论
妄北y
- 粉丝: 1w+
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功