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=))
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。