1 Star 0 Fork 0

walter / thrift_tutorial_cpp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
README.md 1.36 KB
一键复制 编辑 原始数据 按行查看 历史
walter 提交于 2020-03-29 00:07 . thrift cpp教程

thriftdemosrc

thrift -r --gen cpp tutorial.thrift 编译: cd ~/Downloads/GitHub/thrift_tutorial_cpp/cpp mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release .. cmake --build .

/Users/wolingzong/Downloads/GitHub/thrift_tutorial_cpp/cpp/cmake-build-debug/server Starting the server... Incoming connection SocketInfo: <Host: ::1 Port: 55738> PeerHost: localhost PeerAddress: ::1 PeerPort: 55738 ping() add(1, 1) calculate(1, Work(num1=1, num2=0, op=DIVIDE, comment=)) calculate(1, Work(num1=15, num2=10, op=SUBTRACT, comment=)) getStruct(1)

/Users/wolingzong/Downloads/GitHub/thrift_tutorial_cpp/cpp/cmake-build-debug/client ping() 1 + 1 = 2 InvalidOperation: Cannot divide by 0 15 - 10 = 5 Received log: SharedStruct(key=1, value=5)

Process finished with exit code 0

thrift 0.12.0 go build main.go client.go handler.go server.go

C:\Users\Administrator\go\src\go\src>main ping() 1+1=2 Invalid operation: InvalidOperation({WhatOp:4 Why:Cannot divide by 0}) error running client: InvalidOperation({WhatOp:4 Why:Cannot divide by 0})

dong@dong-UP-CHT01:~/golang/project/src/cpp$ ./TutorialServer Starting the server... history Incoming connection SocketInfo: <Host: ::ffff:192.168.1.163 Port: 53625> PeerHost: ::ffff:192.168.1.163 PeerAddress: ::ffff:192.168.1.163 PeerPort: 53625 ping() add(1, 1) calculate(1, Work(num1=1, num2=0, op=DIVIDE, comment=))

C++
1
https://gitee.com/walter80/thrift_tutorial_cpp.git
git@gitee.com:walter80/thrift_tutorial_cpp.git
walter80
thrift_tutorial_cpp
thrift_tutorial_cpp
master

搜索帮助