Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
68 lines (47 sloc) 1.91 KB
// This autogenerated skeleton file illustrates how to build a server.
// You should copy it to another filename to avoid overwriting it.
#define SIGNED_RIGHT_SHIFT_IS 5
#define ARITHMETIC_RIGHT_SHIFT 5
#include <sys/sysmacros.h>
#include <string>
#include <protocol/TBinaryProtocol.h>
#include <protocol/TCompactProtocol.h>
#include <server/TSimpleServer.h>
#include <transport/TServerSocket.h>
#include <transport/TServerTransport.h>
#include <transport/TTransport.h>
#include <transport/TSocket.h>
#include <server/TNonblockingServer.h>
#include <transport/TBufferTransports.h>
#include <concurrency/ThreadManager.h>
using namespace ::apache::thrift;
using namespace ::apache::thrift::protocol;
using namespace ::apache::thrift::transport;
using namespace ::apache::thrift::server;
using boost::shared_ptr;
using namespace std;
#include "MasterClient.h"
int main(int argc, char **argv) {
int port = 9999;
/*
shared_ptr<ClientServiceHandler> handler(new ClientServiceHandler());
shared_ptr<TProcessor> processor(new ClientServiceProcessor(handler));
shared_ptr<TServerTransport> serverTransport(new TServerSocket(port));
shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory());
shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
TSimpleServer server(processor, serverTransport, transportFactory, protocolFactory);
server.serve();
shared_ptr<TTransport> serverTransport( new TSocket("localhost",9997));
shared_ptr<TTransport> transporty( new TFramedTransport(serverTransport));
shared_ptr<TProtocol> protocolPtr( new TCompactProtocol(transporty));
ClientServiceClient *client = new ClientServiceClient(protocolPtr);
serverTransport->open();
string str="";
client->getZooKeepers(str);
cout << str << endl;
transporty->close();
*/
cmaster::MasterClient *interface = new cmaster::MasterClient("localhost",port);
delete interface;
return 0;
}