blob: 7ad6f00bb8e3393151eca368c722f8f2c9c7c7e7 [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
Mark Slee02d1edc2007-03-07 05:17:25 +000013using boost::shared_ptr;
Mark Sleec416a272007-03-05 05:40:37 +000014using namespace facebook::thrift;
15using namespace facebook::thrift::protocol;
16using namespace facebook::thrift::transport;
17using namespace facebook::thrift::server;
18using namespace facebook::thrift::concurrency;
19
20int main(int argc, char **argv) {
21 int port = 9090;
22 std::string host = "localhost";
23
24 shared_ptr<TTransport> transport(new TSocket(host, port));
25 shared_ptr<TProtocol> protocol(new TBinaryProtocol(transport));
26
27 transport->open();
28
29 ThreadsTestClient client(protocol);
30 int val;
31 val = client.threadOne(5);
32 fprintf(stderr, "%d\n", val);
33 val = client.stop();
34 fprintf(stderr, "%d\n", val);
35 val = client.threadTwo(5);
36 fprintf(stderr, "%d\n", val);
37
38 transport->close();
39
40 fprintf(stderr, "done.\n");
41
42 return 0;
43}
44