OpenDDS
Snapshot(2023/04/07-19:43)
|
#include <TransportReceiveStrategy_T.h>
Classes | |
class | ScopedHeaderProcessing |
Public Member Functions | |
virtual | ~TransportReceiveStrategy () |
int | start () |
void | stop () |
int | handle_dds_input (ACE_HANDLE fd) |
virtual void | relink (bool do_suspend=true) |
const TH & | received_header () const |
TH & | received_header () |
const DSH & | received_sample_header () const |
DSH & | received_sample_header () |
ACE_Message_Block * | to_msgblock (const ReceivedDataSample &sample) |
![]() | |
virtual | ~TransportStrategy () |
![]() | |
virtual | ~RcObject () |
virtual void | _add_ref () |
virtual void | _remove_ref () |
long | ref_count () const |
WeakObject * | _get_weak_object () const |
Protected Member Functions | |
TransportReceiveStrategy (const TransportInst_rch &config, size_t receive_buffers_count=RECEIVE_BUFFERS) | |
virtual ssize_t | receive_bytes (iovec iov[], int n, ACE_INET_Addr &remote_address, ACE_HANDLE fd, bool &stop)=0 |
Only our subclass knows how to do this. More... | |
virtual bool | check_header (const TH &header) |
Check the transport header for suitability. More... | |
virtual bool | check_header (const DSH &header) |
Check the data sample header for suitability. More... | |
virtual void | begin_transport_header_processing () |
Begin Current Transport Header Processing. More... | |
virtual void | end_transport_header_processing () |
End Current Transport Header Processing. More... | |
virtual void | deliver_sample (ReceivedDataSample &sample, const ACE_INET_Addr &remote_address)=0 |
Called when there is a ReceivedDataSample to be delivered. More... | |
virtual void | finish_message () |
virtual int | start_i ()=0 |
Let the subclass start. More... | |
virtual void | stop_i ()=0 |
Let the subclass stop. More... | |
int | skip_bad_pdus () |
Ignore bad PDUs by skipping over them. More... | |
void | reset () |
size_t | pdu_remaining () const |
size_t | successor_index (size_t index) const |
Manage an index into the receive buffer array. More... | |
void | update_buffer_index (bool &done) |
virtual bool | reassemble (ReceivedDataSample &data) |
OPENDDS_VECTOR (ACE_Message_Block *) receive_buffers_ | |
Set of receive buffers in use. More... | |
![]() | |
RcObject () | |
Protected Attributes | |
bool | gracefully_disconnected_ |
Flag indicates if the GRACEFUL_DISCONNECT message is received. More... | |
size_t | receive_sample_remaining_ |
Bytes remaining in the current DataSample. More... | |
TH | receive_transport_header_ |
Current receive TransportHeader. More... | |
TransportMessageBlockAllocator | mb_allocator_ |
TransportDataBlockAllocator | db_allocator_ |
TransportDataAllocator | data_allocator_ |
ACE_Lock_Adapter< ACE_SYNCH_MUTEX > | receive_lock_ |
Locking strategy for the allocators. More... | |
size_t | buffer_index_ |
Current receive buffer index in use. More... | |
DSH | data_sample_header_ |
Current data sample header. More... | |
ACE_Message_Block * | payload_ |
bool | good_pdu_ |
size_t | pdu_remaining_ |
Amount of the current PDU that has not been processed yet. More... | |
Additional Inherited Members | |
![]() | |
static const size_t | RECEIVE_BUFFERS = DEFAULT_TRANSPORT_RECEIVE_BUFFERS |
static const size_t | BUFFER_LOW_WATER = 4096 |
static const size_t | MESSAGE_BLOCKS = 1000 |
static const size_t | DATA_BLOCKS = 100 |
This class provides buffer for data received by transports, de-assemble the data to individual samples and deliver them.
Definition at line 50 of file TransportReceiveStrategy_T.h.
|
virtual |
Definition at line 54 of file TransportReceiveStrategy_T.cpp.
|
explicitprotected |
Definition at line 25 of file TransportReceiveStrategy_T.cpp.
|
inlineprotectedvirtual |
Begin Current Transport Header Processing.
Reimplemented in OpenDDS::DCPS::RtpsUdpReceiveStrategy.
Definition at line 98 of file TransportReceiveStrategy_T.h.
|
protectedvirtual |
Check the transport header for suitability.
Reimplemented in OpenDDS::DCPS::RtpsUdpReceiveStrategy, OpenDDS::DCPS::UdpReceiveStrategy, and OpenDDS::DCPS::MulticastReceiveStrategy.
Definition at line 81 of file TransportReceiveStrategy_T.cpp.
Referenced by OpenDDS::DCPS::UdpReceiveStrategy::check_header().
|
protectedvirtual |
Check the data sample header for suitability.
Reimplemented in OpenDDS::DCPS::RtpsUdpReceiveStrategy, OpenDDS::DCPS::UdpReceiveStrategy, and OpenDDS::DCPS::MulticastReceiveStrategy.
Definition at line 88 of file TransportReceiveStrategy_T.cpp.
|
protectedpure virtual |
Called when there is a ReceivedDataSample to be delivered.
Implemented in OpenDDS::DCPS::RtpsUdpReceiveStrategy, OpenDDS::DCPS::TcpReceiveStrategy, OpenDDS::DCPS::MulticastReceiveStrategy, OpenDDS::DCPS::UdpReceiveStrategy, and OpenDDS::DCPS::ShmemReceiveStrategy.
|
inlineprotectedvirtual |
End Current Transport Header Processing.
Reimplemented in OpenDDS::DCPS::RtpsUdpReceiveStrategy.
Definition at line 101 of file TransportReceiveStrategy_T.h.
|
inlineprotectedvirtual |
Definition at line 115 of file TransportReceiveStrategy_T.h.
int OpenDDS::DCPS::TransportReceiveStrategy< TH, DSH >::handle_dds_input | ( | ACE_HANDLE | fd | ) |
Note that this is just an initial implementation. We may take some shortcuts (we will) that will need to be dealt with later once a more robust implementation can be put in place.
Our handle_dds_input() method is called by the reactor when there is data to be pulled from our peer() ACE_SOCK_Stream.
Definition at line 101 of file TransportReceiveStrategy_T.cpp.
|
protected |
Set of receive buffers in use.
|
inlineprotected |
Definition at line 130 of file TransportReceiveStrategy_T.h.
|
protectedvirtual |
Reimplemented in OpenDDS::DCPS::RtpsUdpReceiveStrategy, OpenDDS::DCPS::UdpReceiveStrategy, and OpenDDS::DCPS::MulticastReceiveStrategy.
Definition at line 884 of file TransportReceiveStrategy_T.cpp.
|
protectedpure virtual |
Only our subclass knows how to do this.
Implemented in OpenDDS::DCPS::RtpsUdpReceiveStrategy, OpenDDS::DCPS::TcpReceiveStrategy, OpenDDS::DCPS::UdpReceiveStrategy, OpenDDS::DCPS::MulticastReceiveStrategy, and OpenDDS::DCPS::ShmemReceiveStrategy.
ACE_INLINE const TH & OpenDDS::DCPS::TransportReceiveStrategy< TH, DSH >::received_header | ( | ) | const |
Provides access to the received transport header for subclasses.
Definition at line 29 of file TransportReceiveStrategy_T.inl.
Referenced by OpenDDS::DCPS::ReliableSession::nak_received(), OpenDDS::DCPS::ReliableSession::nakack_received(), OpenDDS::DCPS::MulticastDataLink::ready_to_deliver(), OpenDDS::DCPS::MulticastDataLink::sample_received(), OpenDDS::DCPS::MulticastSession::syn_received(), and OpenDDS::DCPS::MulticastSession::synack_received().
ACE_INLINE TH & OpenDDS::DCPS::TransportReceiveStrategy< TH, DSH >::received_header | ( | ) |
Definition at line 36 of file TransportReceiveStrategy_T.inl.
ACE_INLINE const DSH & OpenDDS::DCPS::TransportReceiveStrategy< TH, DSH >::received_sample_header | ( | ) | const |
Provides access to the received sample header for subclasses.
Definition at line 43 of file TransportReceiveStrategy_T.inl.
ACE_INLINE DSH & OpenDDS::DCPS::TransportReceiveStrategy< TH, DSH >::received_sample_header | ( | ) |
Definition at line 50 of file TransportReceiveStrategy_T.inl.
|
virtual |
The subclass needs to provide the implementation for re-establishing the datalink. This is called when recv returns an error.
Reimplemented in OpenDDS::DCPS::TcpReceiveStrategy.
Definition at line 64 of file TransportReceiveStrategy_T.inl.
|
protected |
For datagram-based derived classes, reset() can be called to clear any state that may be remaining from parsing the previous datagram.
Definition at line 894 of file TransportReceiveStrategy_T.cpp.
|
protected |
Ignore bad PDUs by skipping over them.
Definition at line 931 of file TransportReceiveStrategy_T.cpp.
|
virtual |
Implements OpenDDS::DCPS::TransportStrategy.
Definition at line 13 of file TransportReceiveStrategy_T.inl.
|
protectedpure virtual |
Let the subclass start.
Implemented in OpenDDS::DCPS::RtpsUdpReceiveStrategy, OpenDDS::DCPS::TcpReceiveStrategy, OpenDDS::DCPS::MulticastReceiveStrategy, OpenDDS::DCPS::UdpReceiveStrategy, and OpenDDS::DCPS::ShmemReceiveStrategy.
|
virtual |
Implements OpenDDS::DCPS::TransportStrategy.
Definition at line 21 of file TransportReceiveStrategy_T.inl.
|
protectedpure virtual |
Let the subclass stop.
Implemented in OpenDDS::DCPS::RtpsUdpReceiveStrategy, OpenDDS::DCPS::TcpReceiveStrategy, OpenDDS::DCPS::MulticastReceiveStrategy, OpenDDS::DCPS::UdpReceiveStrategy, and OpenDDS::DCPS::ShmemReceiveStrategy.
|
protected |
Manage an index into the receive buffer array.
Definition at line 57 of file TransportReceiveStrategy_T.inl.
ACE_Message_Block * OpenDDS::DCPS::TransportReceiveStrategy< TH, DSH >::to_msgblock | ( | const ReceivedDataSample & | sample | ) |
Use the receive strategy's Message Block Allocator to convert the ReceivedDataSample's payload to an ACE_Message_Block chain
Definition at line 968 of file TransportReceiveStrategy_T.cpp.
Referenced by OpenDDS::DCPS::ShmemDataLink::request_ack_received().
|
protected |
Definition at line 909 of file TransportReceiveStrategy_T.cpp.
|
protected |
Current receive buffer index in use.
Definition at line 161 of file TransportReceiveStrategy_T.h.
|
protected |
Definition at line 152 of file TransportReceiveStrategy_T.h.
|
protected |
Current data sample header.
Definition at line 164 of file TransportReceiveStrategy_T.h.
|
protected |
Definition at line 151 of file TransportReceiveStrategy_T.h.
|
protected |
Flag indicating that the currently resident PDU is a good one (i.e. has not been received and processed previously). This is included in case we receive PDUs that were resent for reliability reasons and we receive one even if we have already processed it. This is a use case from multicast transports.
Definition at line 174 of file TransportReceiveStrategy_T.h.
|
protected |
Flag indicates if the GRACEFUL_DISCONNECT message is received.
Definition at line 133 of file TransportReceiveStrategy_T.h.
|
protected |
Definition at line 150 of file TransportReceiveStrategy_T.h.
|
protected |
Definition at line 166 of file TransportReceiveStrategy_T.h.
|
protected |
Amount of the current PDU that has not been processed yet.
Definition at line 177 of file TransportReceiveStrategy_T.h.
|
protected |
Locking strategy for the allocators.
Definition at line 155 of file TransportReceiveStrategy_T.h.
|
protected |
Bytes remaining in the current DataSample.
Definition at line 143 of file TransportReceiveStrategy_T.h.
|
protected |
Current receive TransportHeader.
Definition at line 146 of file TransportReceiveStrategy_T.h.