6. thrift
thrift教程
创建match-server:
cd thrift_lesson/match_system/src thrift -r --gen cpp ../../thrift/match.thrift mv gen-cpp match_server rm match_server/Match_server.skeleton.cpp
创建save-client:
cd thrift_lesson/match_system/src thrift -r --gen cpp ../../thrift/save.thrift mv gen-cpp save_client rm save_client/Save_server.skeleton.cpp
创建main.cpp,源代码在这里
编译:
g++ -c main.cpp match_server/*.cpp save_client/*.cpp
链接:
g++ *.o -o main -lthrift -pthread
启动服务:
./main
创建match-client:
cd thrift_lesson/game/src thrift -r --gen py ../../thrift/match.thrift mv gen-py match_client
创建client.py,内容在这里
执行client.py:
python3 client.py