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)
virtual ~TcpReconnectTask ()
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 40 of file TcpReconnectTask.h.


Constructor & Destructor Documentation

OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL OpenDDS::DCPS::TcpReconnectTask::TcpReconnectTask ( TcpConnection con  ) 

Definition at line 16 of file TcpReconnectTask.cpp.

References ACE_TEXT(), DBG_ENTRY_LVL, LM_ERROR, and OpenDDS::DCPS::QueueTaskBase< ReconnectOpType >::open().

00018   : connection_(connection)
00019 {
00020   DBG_ENTRY_LVL("TcpReconnectTask","TcpReconnectTask",6);
00021   if (open()) {
00022     ACE_ERROR((LM_ERROR,
00023                ACE_TEXT("(%P|%t) ERROR: Reconnect task failed to open : %p\n"),
00024                ACE_TEXT("open")));
00025   }
00026 }

Here is the call graph for this function:

OpenDDS::DCPS::TcpReconnectTask::~TcpReconnectTask (  )  [virtual]

Definition at line 28 of file TcpReconnectTask.cpp.

References DBG_ENTRY_LVL.

00029 {
00030   DBG_ENTRY_LVL("TcpReconnectTask","~TcpReconnectTask",6);
00031 }


Member Function Documentation

void OpenDDS::DCPS::TcpReconnectTask::execute ( ReconnectOpType op  )  [virtual]

Handle reconnect requests.

Implements OpenDDS::DCPS::QueueTaskBase< ReconnectOpType >.

Definition at line 33 of file TcpReconnectTask.cpp.

References connection_, DBG_ENTRY_LVL, OpenDDS::DCPS::DO_RECONNECT, LM_ERROR, OpenDDS::DCPS::TcpConnection::reconnect(), SIG_SETMASK, ACE_OS::sigfillset(), sigset_t, OpenDDS::DCPS::TcpConnection::tear_link(), and ACE_OS::thr_sigsetmask().

00034 {
00035   DBG_ENTRY_LVL("TcpReconnectTask","execute",6);
00036 
00037   // Ignore all signals to avoid
00038   //     ERROR: <something descriptive> Interrupted system call
00039   // The main thread will handle signals.
00040   sigset_t set;
00041   ACE_OS::sigfillset(&set);
00042   ACE_OS::thr_sigsetmask(SIG_SETMASK, &set, NULL);
00043 
00044   if (op == DO_RECONNECT) {
00045     if (this->connection_->reconnect() == -1) {
00046       this->connection_->tear_link();
00047     }
00048 
00049   } else
00050     ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: TcpReconnectTask::svc unknown operation %d\n", op));
00051 }

Here is the call graph for this function:


Member Data Documentation

The connection that needs be re-established.

Definition at line 52 of file TcpReconnectTask.h.

Referenced by execute().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1