YarpDataFeedReconnectTask.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #include "config.h"
00032
00033 #include "YarpDataFeedReconnectTask.hpp"
00034
00035 #include <Time.hpp>
00036 #include <ace/Date_Time.h>
00037
00038 #include <iostream>
00039
00040 using namespace mermaid::support::communication;
00041
00042 using mermaid::support::system::Time;
00043
00044 YarpDataFeedReconnectTask::YarpDataFeedReconnectTask (YarpDataFeedInputPort * port) : Task (Time::getCurrentTime(), true, 1.0)
00045 {
00046 port_ = port;
00047 };
00048
00049 void YarpDataFeedReconnectTask::run()
00050 {
00051 std::string producerEntityName = port_->getProducerEntityName();
00052 std::string producerServiceName = port_->getProducerServiceName();
00053 std::string producerDataFeedName = port_->getDataFeedName();
00054 std::cerr << "Attempting to reconnect to Data Feed : " << producerEntityName << "::" << producerServiceName << "::" << producerDataFeedName << std::endl;
00055
00056 if (port_->connect() == true) {
00057 cancelRepeat();
00058 }
00059 };