OpenDDS::DCPS::MulticastReceiveStrategy Class Reference

#include <MulticastReceiveStrategy.h>

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

List of all members.

Public Member Functions

 MulticastReceiveStrategy (MulticastDataLink *link)
virtual ACE_HANDLE get_handle () const
virtual int handle_input (ACE_HANDLE fd)

Protected Member Functions

virtual ssize_t receive_bytes (iovec iov[], int n, ACE_INET_Addr &remote_address, ACE_HANDLE fd)
 Only our subclass knows how to do this.
virtual bool check_header (const TransportHeader &header)
 Check the transport header for suitability.
virtual bool check_header (const DataSampleHeader &header)
 Check the data sample header for suitability.
virtual void deliver_sample (ReceivedDataSample &sample, const ACE_INET_Addr &remote_address)
 Called when there is a ReceivedDataSample to be delivered.
virtual int start_i ()
 Let the subclass start.
virtual void stop_i ()
 Let the subclass stop.
virtual bool reassemble (ReceivedDataSample &data)

Private Attributes

MulticastDataLinklink_

Detailed Description

Definition at line 23 of file MulticastReceiveStrategy.h.


Constructor & Destructor Documentation

OpenDDS::DCPS::MulticastReceiveStrategy::MulticastReceiveStrategy ( MulticastDataLink link  )  [explicit]

Definition at line 18 of file MulticastReceiveStrategy.cpp.

00019   : link_(link)
00020 {
00021 }


Member Function Documentation

bool OpenDDS::DCPS::MulticastReceiveStrategy::check_header ( const DataSampleHeader header  )  [protected, virtual]

Check the data sample header for suitability.

Reimplemented from OpenDDS::DCPS::TransportReceiveStrategy<>.

Definition at line 59 of file MulticastReceiveStrategy.cpp.

References OpenDDS::DCPS::MulticastDataLink::check_header(), and link_.

00060 {
00061   return this->link_->check_header(header);
00062 }

Here is the call graph for this function:

bool OpenDDS::DCPS::MulticastReceiveStrategy::check_header ( const TransportHeader header  )  [protected, virtual]

Check the transport header for suitability.

Reimplemented from OpenDDS::DCPS::TransportReceiveStrategy<>.

Definition at line 53 of file MulticastReceiveStrategy.cpp.

References OpenDDS::DCPS::MulticastDataLink::check_header(), and link_.

00054 {
00055   return this->link_->check_header(header);
00056 }

Here is the call graph for this function:

void OpenDDS::DCPS::MulticastReceiveStrategy::deliver_sample ( ReceivedDataSample sample,
const ACE_INET_Addr remote_address 
) [protected, virtual]

Called when there is a ReceivedDataSample to be delivered.

Implements OpenDDS::DCPS::TransportReceiveStrategy<>.

Definition at line 65 of file MulticastReceiveStrategy.cpp.

References link_, and OpenDDS::DCPS::MulticastDataLink::sample_received().

00067 {
00068   this->link_->sample_received(sample);
00069 }

Here is the call graph for this function:

ACE_HANDLE OpenDDS::DCPS::MulticastReceiveStrategy::get_handle ( void   )  const [virtual]

Reimplemented from ACE_Event_Handler.

Definition at line 24 of file MulticastReceiveStrategy.cpp.

References ACE_IPC_SAP::get_handle(), link_, OpenDDS::DCPS::MulticastDataLink::socket(), and socket().

00025 {
00026   ACE_SOCK_Dgram_Mcast& socket = this->link_->socket();
00027   return socket.get_handle();
00028 }

Here is the call graph for this function:

int OpenDDS::DCPS::MulticastReceiveStrategy::handle_input ( ACE_HANDLE  fd  )  [virtual]

Reimplemented from ACE_Event_Handler.

Definition at line 31 of file MulticastReceiveStrategy.cpp.

References OpenDDS::DCPS::TransportReceiveStrategy<>::handle_dds_input(), LM_DEBUG, OpenDDS::DCPS::TransportReceiveStrategy<>::pdu_remaining(), OpenDDS::DCPS::TransportReceiveStrategy<>::reset(), and VDBG_LVL.

00032 {
00033   const int result = this->handle_dds_input(fd);
00034   if (result >= 0 && this->pdu_remaining()) {
00035     VDBG_LVL((LM_DEBUG, "(%P|%t) MulticastReceiveStrategy[%@]::handle_input "
00036       "resetting with %B bytes remaining\n", this, this->pdu_remaining()), 4);
00037     this->reset();
00038   }
00039   return result;
00040 }

Here is the call graph for this function:

bool OpenDDS::DCPS::MulticastReceiveStrategy::reassemble ( ReceivedDataSample data  )  [protected, virtual]

Reimplemented from OpenDDS::DCPS::TransportReceiveStrategy<>.

Definition at line 72 of file MulticastReceiveStrategy.cpp.

References link_, OpenDDS::DCPS::MulticastDataLink::reassemble(), and OpenDDS::DCPS::TransportReceiveStrategy<>::received_header().

00073 {
00074   return this->link_->reassemble(data, received_header());
00075 }

Here is the call graph for this function:

ssize_t OpenDDS::DCPS::MulticastReceiveStrategy::receive_bytes ( iovec  iov[],
int  n,
ACE_INET_Addr remote_address,
ACE_HANDLE  fd 
) [protected, virtual]

Only our subclass knows how to do this.

Implements OpenDDS::DCPS::TransportReceiveStrategy<>.

Definition at line 43 of file MulticastReceiveStrategy.cpp.

References link_, ACE_SOCK_Dgram::recv(), OpenDDS::DCPS::MulticastDataLink::socket(), and socket().

00047 {
00048   ACE_SOCK_Dgram_Mcast& socket = this->link_->socket();
00049   return socket.recv(iov, n, remote_address);
00050 }

Here is the call graph for this function:

int OpenDDS::DCPS::MulticastReceiveStrategy::start_i (  )  [protected, virtual]

Let the subclass start.

Implements OpenDDS::DCPS::TransportReceiveStrategy<>.

Definition at line 78 of file MulticastReceiveStrategy.cpp.

References ACE_TEXT(), OpenDDS::DCPS::MulticastDataLink::get_reactor(), link_, LM_ERROR, ACE_Event_Handler::reactor(), ACE_Event_Handler::READ_MASK, and ACE_Reactor::register_handler().

00079 {
00080   ACE_Reactor* reactor = this->link_->get_reactor();
00081   if (reactor == 0) {
00082     ACE_ERROR_RETURN((LM_ERROR,
00083                       ACE_TEXT("(%P|%t) ERROR: ")
00084                       ACE_TEXT("MulticastReceiveStrategy::start_i: ")
00085                       ACE_TEXT("NULL reactor reference!\n")),
00086                      -1);
00087   }
00088 
00089   if (reactor->register_handler(this, ACE_Event_Handler::READ_MASK) != 0) {
00090     ACE_ERROR_RETURN((LM_ERROR,
00091                       ACE_TEXT("(%P|%t) ERROR: ")
00092                       ACE_TEXT("MulticastReceiveStrategy::start_i: ")
00093                       ACE_TEXT("failed to register handler for DataLink!\n")),
00094                      -1);
00095   }
00096 
00097   return 0;
00098 }

Here is the call graph for this function:

void OpenDDS::DCPS::MulticastReceiveStrategy::stop_i (  )  [protected, virtual]

Let the subclass stop.

Implements OpenDDS::DCPS::TransportReceiveStrategy<>.

Definition at line 101 of file MulticastReceiveStrategy.cpp.

References ACE_TEXT(), OpenDDS::DCPS::MulticastDataLink::get_reactor(), link_, LM_ERROR, ACE_Event_Handler::reactor(), ACE_Event_Handler::READ_MASK, and ACE_Reactor::remove_handler().

00102 {
00103   ACE_Reactor* reactor = this->link_->get_reactor();
00104   if (reactor == 0) {
00105     ACE_ERROR((LM_ERROR,
00106                ACE_TEXT("(%P|%t) ERROR: ")
00107                ACE_TEXT("MulticastReceiveStrategy::stop_i: ")
00108                ACE_TEXT("NULL reactor reference!\n")));
00109     return;
00110   }
00111 
00112   reactor->remove_handler(this, ACE_Event_Handler::READ_MASK);
00113 }

Here is the call graph for this function:


Member Data Documentation


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