This repository has been archived by the owner on Nov 15, 2019. It is now read-only.
forked from qicosmos/rest_rpc_old
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Madoka
authored and
Madoka
committed
Nov 1, 2016
1 parent
a2a215f
commit 2456e92
Showing
1 changed file
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,45 @@ | |
|
||
[江南(qicosmos)](https://github.com/qicosmos),[IndignantAngel](https://github.com/IndignantAngel) | ||
|
||
|
||
##Contact us | ||
[email protected] | ||
|
||
-------------------------- | ||
|
||
## rest_rpc v0.91 release note | ||
#### 新增特性 | ||
1. 提供纯转发接口,与纯转发协议,客户端增加了forward接口与之对应 | ||
```cpp | ||
// server.cpp | ||
server.register_forward_handler("pub_data", [&server](char const* data, size_t size) | ||
{ | ||
server.pub("your_topic", data ,size); | ||
}); | ||
``` | ||
2. 业务函数可选择附加第一个形参为连接的shared指针 | ||
```cpp | ||
server.register_handler("add_with_conn", [] | ||
(timax::rpc::connection_ptr conn, int a, int b) | ||
{ | ||
auto result = a + b; | ||
if (result < 1) | ||
conn->close(); | ||
return result; | ||
}); | ||
``` | ||
3. 客户端添加private接口,拥有更高的权限和更多的流程控制 | ||
4. server端的pub提供了一个纯转发的重载实现 | ||
5. 提供管理多个endpoint的工具 | ||
```cpp | ||
auto endpoints = timax::rpc::get_tcp_endpoints("127.0.0.1:5001|127.0.0.1:5002"); | ||
for(auto const& endpoint : endpoints) | ||
{ | ||
std::cout << endpoint << std::endl; | ||
} | ||
``` | ||
6. 客户端pub接口的,将会把转发协议的name当做topic,广播给所有监听这个topic的客户端,而不需要再服务器上注册handler; | ||
7. 服务器注册handler,将使用hash值代替字符串 | ||
#### Bug修复 | ||
1. rpc超时后异步调用链断开 | ||
2. 客户端和服务器read大块消息时,因使用boost::bind,而发生了意外地拷贝,招致读取到不正确的地址 | ||
3. 支持更低版本的编译器 |