OpenDDS::DCPS::TcpReconnectTask Class Reference

Active Object managing a queue of reconnecting request. More...

#include <TcpReconnectTask.h>

Inheritance diagram for OpenDDS::DCPS::TcpReconnectTask:

Inheritance graph
[legend]
Collaboration diagram for OpenDDS::DCPS::TcpReconnectTask:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TcpReconnectTask (TcpConnection *con)
 Constructor.
virtual ~TcpReconnectTask ()
 Virtual Destructor.
virtual void execute (ReconnectOpType &op)
 Handle reconnect requests.

Private Attributes

TcpConnectionconnection_
 The connection that needs be re-established.

Detailed Description

Active Object managing a queue of reconnecting request.

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.


Constructor & Destructor Documentation

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 }


Member Function Documentation

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 }


Member Data Documentation

TcpConnection* OpenDDS::DCPS::TcpReconnectTask::connection_ [private]

The connection that needs be re-established.

Definition at line 53 of file TcpReconnectTask.h.


The documentation for this class was generated from the following files:
Generated on Fri Feb 12 20:06:39 2016 for OpenDDS by  doxygen 1.4.7