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

TAO_ECG_UDP_Receiver Class Reference

Decodes events from an ACE_SOCK_Dgram and pushes them to the Event_Channel. More...

#include <EC_Gateway_UDP.h>

Collaboration diagram for TAO_ECG_UDP_Receiver:

Collaboration graph
[legend]
List of all members.

Public Methods

 TAO_ECG_UDP_Receiver (void)
void init (RtecEventChannelAdmin::EventChannel_ptr lcl_ec, TAO_ECG_UDP_Out_Endpoint *ignore_from, RtecUDPAdmin::AddrServer_ptr addr_server, ACE_Reactor *reactor, const ACE_Time_Value &expire_interval, int max_timeout ACE_ENV_ARG_DECL_WITH_DEFAULTS)
 To do its job this class requires to know the local EC it will connect to; it also requires to build an RT_Info for the local scheduler. More...

void shutdown (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
 Disconnect and shutdown the gateway, no further connectsions. More...

void open (RtecEventChannelAdmin::SupplierQOS &pub ACE_ENV_ARG_DECL_WITH_DEFAULTS)
 Connect to the EC using the given publications lists. More...

virtual void close (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
 Disconnect to the EC. More...

int handle_input (ACE_SOCK_Dgram &dgram)
 The Event_Handlers call this method when data is available at the socket, the <dgram> must be ready for reading and contain a full event. More...

int handle_timeout (const ACE_Time_Value &tv, const void *act)
 The timer has expired, must update all the unreceived messages... More...

virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) throw (CORBA::SystemException)
void get_addr (const RtecEventComm::EventHeader &header, RtecUDPAdmin::UDP_Addr_out addr ACE_ENV_ARG_DECL_WITH_DEFAULTS)
 Call the RtecUDPAdmin::AddrServer. More...


Private Types

typedef ACE_Hash_Map_Manager<
TAO_ECG_UDP_Request_Index,
TAO_ECG_UDP_Request_Entry *,
TAO_SYNCH_MUTEX
Request_Map
typedef ACE_Hash_Map_Entry<
TAO_ECG_UDP_Request_Index,
TAO_ECG_UDP_Request_Entry *> 
Request_Map_Entry

Private Attributes

RtecEventChannelAdmin::EventChannel_var lcl_ec_
 The remote and the local EC, so we can reconnect when the list changes. More...

RtecEventChannelAdmin::ProxyPushConsumer_var consumer_proxy_
 We talk to the EC (as a consumer) using this proxy. More...

TAO_ECG_UDP_Out_Endpointignore_from_
 Ignore any events coming from this IP addres. More...

RtecUDPAdmin::AddrServer_var addr_server_
 The server used to map event types into multicast groups. More...

Request_Map request_map_
 The map containing all the incoming requests which have been partially received. More...

TAO_ECG_UDP_TH timeout_handler_
 To receive the timeouts.. More...

ACE_Reactorreactor_
 The reactor we are using for the timeout handler... More...

int max_timeout_
 How many timeouts before we expire a message... More...


Detailed Description

Decodes events from an ACE_SOCK_Dgram and pushes them to the Event_Channel.

This supplier receives events from an ACE_SOCK_Dgram, either from a UDP socket or a Mcast group, decodes them and push them to the EC. = REASSEMBLY 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, and the memory reclaimed. The entry is *not* removed until the timer expires (to handle re-transmitions).


Member Typedef Documentation

typedef ACE_Hash_Map_Manager<TAO_ECG_UDP_Request_Index, TAO_ECG_UDP_Request_Entry*, TAO_SYNCH_MUTEX> TAO_ECG_UDP_Receiver::Request_Map [private]
 

typedef ACE_Hash_Map_Entry<TAO_ECG_UDP_Request_Index, TAO_ECG_UDP_Request_Entry*> TAO_ECG_UDP_Receiver::Request_Map_Entry [private]
 


Constructor & Destructor Documentation

TAO_ECG_UDP_Receiver::TAO_ECG_UDP_Receiver void   
 


Member Function Documentation

void TAO_ECG_UDP_Receiver::close ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS    [virtual]
 

Disconnect to the EC.

void TAO_ECG_UDP_Receiver::disconnect_push_supplier ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS    throw (CORBA::SystemException) [virtual]
 

void TAO_ECG_UDP_Receiver::get_addr const RtecEventComm::EventHeader   header,
RtecUDPAdmin::UDP_Addr_out addr    ACE_ENV_ARG_DECL
 

Call the RtecUDPAdmin::AddrServer.

int TAO_ECG_UDP_Receiver::handle_input ACE_SOCK_Dgram   dgram
 

The Event_Handlers call this method when data is available at the socket, the <dgram> must be ready for reading and contain a full event.

int TAO_ECG_UDP_Receiver::handle_timeout const ACE_Time_Value   tv,
const void *    act
 

The timer has expired, must update all the unreceived messages...

void TAO_ECG_UDP_Receiver::init RtecEventChannelAdmin::EventChannel_ptr    lcl_ec,
TAO_ECG_UDP_Out_Endpoint   ignore_from,
RtecUDPAdmin::AddrServer_ptr    addr_server,
ACE_Reactor   reactor,
const ACE_Time_Value   expire_interval,
int max_timeout    ACE_ENV_ARG_DECL_NOT_USED
 

To do its job this class requires to know the local EC it will connect to; it also requires to build an RT_Info for the local scheduler.

The <reactor> is used to receive timeout events.. The <ignore_from> endpoint is used to remove events generated by the same process.

Todo:
part of the RT_Info is hardcoded, we need to make it parametric.

void TAO_ECG_UDP_Receiver::open RtecEventChannelAdmin::SupplierQOS &pub    ACE_ENV_ARG_DECL
 

Connect to the EC using the given publications lists.

void TAO_ECG_UDP_Receiver::shutdown ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS   
 

Disconnect and shutdown the gateway, no further connectsions.


Member Data Documentation

RtecUDPAdmin::AddrServer_var TAO_ECG_UDP_Receiver::addr_server_ [private]
 

The server used to map event types into multicast groups.

RtecEventChannelAdmin::ProxyPushConsumer_var TAO_ECG_UDP_Receiver::consumer_proxy_ [private]
 

We talk to the EC (as a consumer) using this proxy.

TAO_ECG_UDP_Out_Endpoint* TAO_ECG_UDP_Receiver::ignore_from_ [private]
 

Ignore any events coming from this IP addres.

RtecEventChannelAdmin::EventChannel_var TAO_ECG_UDP_Receiver::lcl_ec_ [private]
 

The remote and the local EC, so we can reconnect when the list changes.

int TAO_ECG_UDP_Receiver::max_timeout_ [private]
 

How many timeouts before we expire a message...

ACE_Reactor* TAO_ECG_UDP_Receiver::reactor_ [private]
 

The reactor we are using for the timeout handler...

Request_Map TAO_ECG_UDP_Receiver::request_map_ [private]
 

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

TAO_ECG_UDP_TH TAO_ECG_UDP_Receiver::timeout_handler_ [private]
 

To receive the timeouts..


The documentation for this class was generated from the following files:
Generated on Thu Oct 10 21:17:32 2002 for TAO_RTEvent by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001