Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# TAO_ECG_CDR_Message_Receiver Class Reference

Receives UDP and Multicast messages. More...

`#include <ECG_CDR_Message_Receiver.h>`

Collaboration diagram for TAO_ECG_CDR_Message_Receiver:

[legend]
List of all members.

## Public Methods
int | handle_input (ACE_SOCK_Dgram &dgram, TAO_ECG_CDR_Processor *cdr_processor)
| TAO_ECG_CDR_Message_Receiver (CORBA::Boolean check_crc)
| ~TAO_ECG_CDR_Message_Receiver (void)
void | init (TAO_ECG_Refcounted_Endpoint ignore_from)
void | shutdown (void)
## Static Public Attributes
TAO_ECG_UDP_Request_Entry | Request_Completed_
## Private Types
typedef ACE_Hash_Map_Manager< ACE_INET_Addr, Requests *, ACE_Null_Mutex > | Request_Map
enum | { ECG_DEFAULT_MAX_FRAGMENTED_REQUESTS = 1024, ECG_DEFAULT_FRAGMENTED_REQUESTS_MIN_PURGE_COUNT = 32 }
## Private Methods
int | mark_received (const ACE_INET_Addr &from, CORBA::ULong request_id)
int | process_fragment (const ACE_INET_Addr &from, const Mcast_Header &header, char *data_buf, TAO_ECG_CDR_Processor *cdr_processor)
Request_Map::ENTRY * | get_source_entry (const ACE_INET_Addr &from)
## Private Attributes
TAO_ECG_Refcounted_Endpoint | ignore_from_
| Ignore any events coming from this IP address.
Request_Map | request_map_
size_t | max_requests_
| Serializes use of <request_map_>.
size_t | min_purge_count_
CORBA::Boolean | check_crc_
| Flag to indicate whether CRC should be computed and checked.

## Detailed Description

Receives UDP and Multicast messages.

Todo:
  Update class documentation below.

5) Make status array size and purge_count configurable.

This class receives UDP and Multicast message fragments, assembles them (described in detail below), and passes complete messages in the form of cdr streams to the calling classes.

This class is used by various Gateway classes (Senders/Receivers) responsible for federating Event Channels with UDP/Mcast.

= REASSEMBLY Fragmentation is described in ECG_CDR_Message_Sender.h Whenever an incomplete fragment is received (one with fragment_count > 1) we allocate an entry for the message in an map indexed by (host,port,request_id). The entry contains the buffer, a bit vector to keep track of the fragments received so far, and a timeout counter. This timeout counter is set to 0 on each (new) fragment arrival, and incremented on a regular basis. If the counter reaches a maximum value the message is dropped. Once all the fragments have been received the message is sent up to the calling classes, and the memory reclaimed.

## Member Typedef Documentation

typedef ACE_Hash_Map_Manager<ACE_INET_Addr, Requests*, ACE_Null_Mutex> TAO_ECG_CDR_Message_Receiver::Request_Map`[private]`

## Member Enumeration Documentation

anonymous enum`[private]`

  | Enumeration values:
  ECG_DEFAULT_MAX_FRAGMENTED_REQUESTS |
  ECG_DEFAULT_FRAGMENTED_REQUESTS_MIN_PURGE_COUNT |

## Constructor & Destructor Documentation

ACE_INLINE TAO_ECG_CDR_Message_Receiver::TAO_ECG_CDR_Message_Receiver | ( | CORBA::Boolean | check_crc | ) |

ACE_INLINE TAO_ECG_CDR_Message_Receiver::~TAO_ECG_CDR_Message_Receiver | ( | void |  | ) |

## Member Function Documentation

TAO_ECG_CDR_Message_Receiver::Request_Map::ENTRY * TAO_ECG_CDR_Message_Receiver::get_source_entry | ( | const ACE_INET_Addr & | from | ) | `[private]`

int TAO_ECG_CDR_Message_Receiver::handle_input | ( | ACE_SOCK_Dgram & | dgram,
|  | TAO_ECG_CDR_Processor * | cdr_processor
| ) |

| Returns 1 if data was read successfully and accepted by <cdr_processor> without errors. Returns 0 if there were no errors, but no data has been passed to <cdr_processor>, either due to request being incomplete (not all fragments received), or it being a duplicate. Returns -1 if there were errors.

ACE_INLINE void TAO_ECG_CDR_Message_Receiver::init | ( | TAO_ECG_Refcounted_Endpoint | ignore_from | ) |

  | Parameters:
  ignore_from | Endpoint used to remove events generated by the same process.

int TAO_ECG_CDR_Message_Receiver::mark_received | ( | const ACE_INET_Addr & | from,
|  | CORBA::ULong | request_id
| ) | `[private]`

| Returns 1 on success, 0 if <request_id> has already been received or is below current request range, and -1 on error.

int TAO_ECG_CDR_Message_Receiver::process_fragment | ( | const ACE_INET_Addr & | from,
|  | const Mcast_Header & | header,
|  | char * | data_buf,
|  | TAO_ECG_CDR_Processor * | cdr_processor
| ) | `[private]`

| Returns 1 if complete request is received and <event> is populated, 0 if request has only partially been received or is a duplicate, and -1 on error.

ACE_INLINE void TAO_ECG_CDR_Message_Receiver::shutdown | ( | void |  | ) |

## Member Data Documentation

CORBA::Boolean TAO_ECG_CDR_Message_Receiver::check_crc_`[private]`

| Flag to indicate whether CRC should be computed and checked.

TAO_ECG_Refcounted_Endpoint TAO_ECG_CDR_Message_Receiver::ignore_from_`[private]`

| Ignore any events coming from this IP address.

size_t TAO_ECG_CDR_Message_Receiver::max_requests_`[private]`

| Serializes use of <request_map_>. Size of a fragmented requests array, i.e., max number of partially received requests kept at any given time per source.

size_t TAO_ECG_CDR_Message_Receiver::min_purge_count_`[private]`

| Minimum number of requests purged from a fragmented requests array when the range of requests represented there needs to be shifted.

TAO_ECG_UDP_Request_Entry TAO_ECG_CDR_Message_Receiver::Request_Completed_`[static]`

| Represents any request that has been fully received and serviced, to simplify the internal logic.

Request_Map TAO_ECG_CDR_Message_Receiver::request_map_`[private]`

| The map containing all the incoming requests which have been partially received.

The documentation for this class was generated from the following files:

- ECG_CDR_Message_Receiver.h
- ECG_CDR_Message_Receiver.cpp
- ECG_CDR_Message_Receiver.i