source: ntrip/trunk/GnssCenter/thrift/rtnet_sdo_example/RtnetDataRequest.cpp@ 7938

Last change on this file since 7938 was 4941, checked in by mervart, 12 years ago
File size: 1.1 KB
RevLine 
[4941]1#include "RtnetDataRequest.h"
2
3#include <cstdio>
4
5using namespace apache::thrift;
6using namespace apache::thrift::protocol;
7using namespace com::gpssolutions::rtnet;
8
9RtnetDataRequest::RtnetDataRequest(boost::shared_ptr<TProtocol>& protocol,
10 boost::shared_ptr<ConnectionStatusMonitor>& connectionMonitor)
11 : ConnectionRequiredRunnable(connectionMonitor,"RtnetDataRequestService"),
12 client_(new RtnetDataClient(protocol))
13{
14}
15
16void
17RtnetDataRequest::run() {
18 printf("Starting RtnetDataRequest thread.\n");
19 while (!stop_) {
20 printf("waiting for connection\n");
21 connectWait();
22 printf("Connected to rtnet\n");
23 if (stop_) {
24 printf("Quitting RtnetDataRequest thread (stop is true)\n");
25 return;
26 }
27 try {
28 printf("sending request for rtnet data stream\n");
29 client_->startDataStream();
30 disconnectWait();
31 } catch (TException& e) {
32 fprintf(stderr,"Caught an exception generated by Thrift in RtnetDataRequest: %s\n",e.what());
33 }
34 }
35 printf("Quitting RtnetDataRequest thread\n");
36}
37
Note: See TracBrowser for help on using the repository browser.