#include <MulticastReceiveStrategy.h>
Inheritance diagram for OpenDDS::DCPS::MulticastReceiveStrategy:
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) |
virtual bool | check_header (const DataSampleHeader &header) |
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 | |
MulticastDataLink * | link_ |
Definition at line 22 of file MulticastReceiveStrategy.h.
OpenDDS::DCPS::MulticastReceiveStrategy::MulticastReceiveStrategy | ( | MulticastDataLink * | link | ) | [explicit] |
bool OpenDDS::DCPS::MulticastReceiveStrategy::check_header | ( | const DataSampleHeader & | header | ) | [protected, virtual] |
Definition at line 57 of file MulticastReceiveStrategy.cpp.
References OpenDDS::DCPS::MulticastDataLink::check_header(), header, and link_.
bool OpenDDS::DCPS::MulticastReceiveStrategy::check_header | ( | const TransportHeader & | header | ) | [protected, virtual] |
Definition at line 51 of file MulticastReceiveStrategy.cpp.
References OpenDDS::DCPS::MulticastDataLink::check_header(), header, and link_.
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< TH, DSH >.
Definition at line 63 of file MulticastReceiveStrategy.cpp.
References link_, and OpenDDS::DCPS::MulticastDataLink::sample_received().
00065 { 00066 this->link_->sample_received(sample); 00067 }
ACE_HANDLE OpenDDS::DCPS::MulticastReceiveStrategy::get_handle | ( | ) | const [virtual] |
Definition at line 22 of file MulticastReceiveStrategy.cpp.
References link_, and OpenDDS::DCPS::MulticastDataLink::socket().
00023 { 00024 ACE_SOCK_Dgram_Mcast& socket = this->link_->socket(); 00025 return socket.get_handle(); 00026 }
int OpenDDS::DCPS::MulticastReceiveStrategy::handle_input | ( | ACE_HANDLE | fd | ) | [virtual] |
Definition at line 29 of file MulticastReceiveStrategy.cpp.
References OpenDDS::DCPS::TransportReceiveStrategy< TH, DSH >::handle_dds_input(), OpenDDS::DCPS::TransportReceiveStrategy< TH, DSH >::reset(), and VDBG_LVL.
00030 { 00031 const int result = this->handle_dds_input(fd); 00032 if (result >= 0 && this->pdu_remaining()) { 00033 VDBG_LVL((LM_DEBUG, "(%P|%t) MulticastReceiveStrategy[%@]::handle_input " 00034 "resetting with %B bytes remaining\n", this, this->pdu_remaining()), 4); 00035 this->reset(); 00036 } 00037 return result; 00038 }
bool OpenDDS::DCPS::MulticastReceiveStrategy::reassemble | ( | ReceivedDataSample & | data | ) | [protected, virtual] |
Reimplemented from OpenDDS::DCPS::TransportReceiveStrategy< TH, DSH >.
Definition at line 70 of file MulticastReceiveStrategy.cpp.
References link_, OpenDDS::DCPS::MulticastDataLink::reassemble(), and OpenDDS::DCPS::TransportReceiveStrategy< TH, DSH >::received_header().
00071 { 00072 return this->link_->reassemble(data, received_header()); 00073 }
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< TH, DSH >.
Definition at line 41 of file MulticastReceiveStrategy.cpp.
References link_, and OpenDDS::DCPS::MulticastDataLink::socket().
00045 { 00046 ACE_SOCK_Dgram_Mcast& socket = this->link_->socket(); 00047 return socket.recv(iov, n, remote_address); 00048 }
int OpenDDS::DCPS::MulticastReceiveStrategy::start_i | ( | ) | [protected, virtual] |
Let the subclass start.
Implements OpenDDS::DCPS::TransportReceiveStrategy< TH, DSH >.
Definition at line 76 of file MulticastReceiveStrategy.cpp.
References OpenDDS::DCPS::MulticastDataLink::get_reactor(), and link_.
00077 { 00078 ACE_Reactor* reactor = this->link_->get_reactor(); 00079 if (reactor == 0) { 00080 ACE_ERROR_RETURN((LM_ERROR, 00081 ACE_TEXT("(%P|%t) ERROR: ") 00082 ACE_TEXT("MulticastReceiveStrategy::start_i: ") 00083 ACE_TEXT("NULL reactor reference!\n")), 00084 -1); 00085 } 00086 00087 if (reactor->register_handler(this, ACE_Event_Handler::READ_MASK) != 0) { 00088 ACE_ERROR_RETURN((LM_ERROR, 00089 ACE_TEXT("(%P|%t) ERROR: ") 00090 ACE_TEXT("MulticastReceiveStrategy::start_i: ") 00091 ACE_TEXT("failed to register handler for DataLink!\n")), 00092 -1); 00093 } 00094 00095 return 0; 00096 }
void OpenDDS::DCPS::MulticastReceiveStrategy::stop_i | ( | ) | [protected, virtual] |
Let the subclass stop.
Implements OpenDDS::DCPS::TransportReceiveStrategy< TH, DSH >.
Definition at line 99 of file MulticastReceiveStrategy.cpp.
References OpenDDS::DCPS::MulticastDataLink::get_reactor(), and link_.
00100 { 00101 ACE_Reactor* reactor = this->link_->get_reactor(); 00102 if (reactor == 0) { 00103 ACE_ERROR((LM_ERROR, 00104 ACE_TEXT("(%P|%t) ERROR: ") 00105 ACE_TEXT("MulticastReceiveStrategy::stop_i: ") 00106 ACE_TEXT("NULL reactor reference!\n"))); 00107 return; 00108 } 00109 00110 reactor->remove_handler(this, ACE_Event_Handler::READ_MASK); 00111 }
Definition at line 49 of file MulticastReceiveStrategy.h.
Referenced by check_header(), deliver_sample(), get_handle(), reassemble(), receive_bytes(), start_i(), and stop_i().