#!/usr/local/bin/thrift --gen cpp
namespace cpp Test
namespace java com.thrift.test
service NucInfoExchange {
}
git clone https://github.com/apache/thrift.git
cd thrift
./bootstrap.sh
./configure
make
sudo make install
// This autogenerated skeleton file illustrates how to build a server.
// You should copy it to another filename to avoid overwriting it.
#include "NucInfoExchange.h"
#include <thrift/concurrency/PlatformThreadFactory.h>
#include <thrift/transport/TSocket.h>
#include <thrift/transport/TTransportUtils.h>
#include <thrift/TToString.h>
#include <thrift/stdcxx.h>
#include <thrift/protocol/TBinaryProtocol.h>
#include <thrift/server/TSimpleServer.h>
#include <thrift/transport/TServerSocket.h>
#include <thrift/transport/TBufferTransports.h>
#include <thrift/concurrency/ThreadManager.h>
#include <thrift/concurrency/PosixThreadFactory.h>
#include <thrift/server/TThreadPoolServer.h>
#include <thrift/server/TThreadedServer.h>
#include <iostream>
#include <stdexcept>
#include <sstream>
using namespace std;
using namespace ::apache::thrift;
using namespace ::apache::thrift::protocol;
using namespace ::apache::thrift::transport;
using namespace ::apache::thrift::server;
using namespace ::apache::thrift::concurrency;
class NucInfoExchangeHandler : virtual public NucInfoExchangeIf {
};
class NucInfoExchangeCloneFactory : virtual public NucInfoExchangeIfFactory {
};
int main(int argc, char **argv) {
*/
}
文章来源: 某课最新《Socket网络编程进阶与实战》