blob: d8f67669c49cc02ca311191efca8b7b0a887b2ff [file] [log] [blame]
Mark Sleec416a272007-03-05 05:40:37 +00001// This autogenerated skeleton file illustrates how to build a server.
2// You should copy it to another filename to avoid overwriting it.
3
4#include "ThreadsTest.h"
5#include <protocol/TBinaryProtocol.h>
6#include <server/TThreadPoolServer.h>
7#include <transport/TSocket.h>
8#include <transport/TTransportUtils.h>
9#include <thrift/concurrency/Monitor.h>
10#include <thrift/concurrency/ThreadManager.h>
11#include <thrift/concurrency/PosixThreadFactory.h>
12
13using namespace facebook::thrift;
14using namespace facebook::thrift::protocol;
15using namespace facebook::thrift::transport;
16using namespace facebook::thrift::server;
17using namespace facebook::thrift::concurrency;
18
19int main(int argc, char **argv) {
20 int port = 9090;
21 std::string host = "localhost";
22
23 shared_ptr<TTransport> transport(new TSocket(host, port));
24 shared_ptr<TProtocol> protocol(new TBinaryProtocol(transport));
25
26 transport->open();
27
28 ThreadsTestClient client(protocol);
29 int val;
30 val = client.threadOne(5);
31 fprintf(stderr, "%d\n", val);
32 val = client.stop();
33 fprintf(stderr, "%d\n", val);
34 val = client.threadTwo(5);
35 fprintf(stderr, "%d\n", val);
36
37 transport->close();
38
39 fprintf(stderr, "done.\n");
40
41 return 0;
42}
43