| 40 | using namespace apache::thrift::concurrency; |
| 41 | |
| 42 | int main(int argc, char **argv) { |
| 43 | #if _WIN32 |
| 44 | transport::TWinsockSingleton::create(); |
| 45 | #endif |
| 46 | int port = 9090; |
| 47 | std::string host = "localhost"; |
| 48 | |
| 49 | shared_ptr<TTransport> transport(new TSocket(host, port)); |
| 50 | shared_ptr<TProtocol> protocol(new TBinaryProtocol(transport)); |
| 51 | |
| 52 | transport->open(); |
| 53 | |
| 54 | ThreadsTestClient client(protocol); |
| 55 | int val; |
| 56 | val = client.threadOne(5); |
| 57 | fprintf(stderr, "%d\n", val); |
| 58 | val = client.stop(); |
| 59 | fprintf(stderr, "%d\n", val); |
| 60 | val = client.threadTwo(5); |
| 61 | fprintf(stderr, "%d\n", val); |
| 62 | |
| 63 | transport->close(); |
| 64 | |
| 65 | fprintf(stderr, "done.\n"); |
| 66 | |
| 67 | return 0; |
| 68 | } |
| 69 | |