72 Star 329 Fork 136

百度开源 / BRPC

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
dummy_server.md 936 Bytes
一键复制 编辑 原始数据 按行查看 历史
zhujiashun 提交于 2017-11-10 13:08 . polish en/dummy_server.md

If your program only uses client in brpc or doesn't use brpc at all, but you also want to use built-in services in brpc. The thing you should do is to start an empty server, which is called dummy server.

client in brpc is used

Create a file named dummy_server.port which contains a port number(such as 8888) in the running directory of program, a dummy server would be started at this port. All of the bvar in the same process can be seen by visiting its built-in service. img img

img

brpc is not used at all

You must manually add the dummy server. First read Getting Started to learn how to download and compile brpc, and then add the following code snippet at the program entry:

#include <brpc/server.h>
 
...
 
int main() {
    ...
    brpc::StartDummyServerAt(8888/*port*/);
    ...
}
C/C++
1
https://gitee.com/baidu/BRPC.git
git@gitee.com:baidu/BRPC.git
baidu
BRPC
BRPC
master

搜索帮助