#include <TcpReconnectTask.h>
Inheritance diagram for OpenDDS::DCPS::TcpReconnectTask:
Public Member Functions | |
TcpReconnectTask (TcpConnection *con) | |
Constructor. | |
virtual | ~TcpReconnectTask () |
Virtual Destructor. | |
virtual void | execute (ReconnectOpType &op) |
Handle reconnect requests. | |
Private Attributes | |
TcpConnection * | connection_ |
The connection that needs be re-established. |
This task handles request to reconnect to the remotes to avoid the the caller threads (thread to send or reactor thread) block on reconnecting. This reconnect task has lifetime as TcpConnection object. One reconnect task just dedicates to a single connection.
Definition at line 38 of file TcpReconnectTask.h.
OpenDDS::DCPS::TcpReconnectTask::TcpReconnectTask | ( | TcpConnection * | con | ) |
Constructor.
Definition at line 14 of file TcpReconnectTask.cpp.
References DBG_ENTRY_LVL.
00016 : connection_(connection) 00017 { 00018 DBG_ENTRY_LVL("TcpReconnectTask","TcpReconnectTask",6); 00019 }
OpenDDS::DCPS::TcpReconnectTask::~TcpReconnectTask | ( | ) | [virtual] |
Virtual Destructor.
Definition at line 21 of file TcpReconnectTask.cpp.
References DBG_ENTRY_LVL.
00022 { 00023 DBG_ENTRY_LVL("TcpReconnectTask","~TcpReconnectTask",6); 00024 }
void OpenDDS::DCPS::TcpReconnectTask::execute | ( | ReconnectOpType & | op | ) | [virtual] |
Handle reconnect requests.
Implements OpenDDS::DCPS::QueueTaskBase< ReconnectOpType >.
Definition at line 26 of file TcpReconnectTask.cpp.
References DBG_ENTRY_LVL, and OpenDDS::DCPS::DO_RECONNECT.
00027 { 00028 DBG_ENTRY_LVL("TcpReconnectTask","execute",6); 00029 00030 // Ignore all signals to avoid 00031 // ERROR: <something descriptive> Interrupted system call 00032 // The main thread will handle signals. 00033 sigset_t set; 00034 ACE_OS::sigfillset(&set); 00035 ACE_OS::thr_sigsetmask(SIG_SETMASK, &set, NULL); 00036 00037 if (op == DO_RECONNECT) { 00038 if (this->connection_->reconnect() == -1) { 00039 this->connection_->tear_link(); 00040 } 00041 00042 } else 00043 ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: TcpReconnectTask::svc unknown operation %d\n", op)); 00044 }