TAO_ECG_UDP_Receiver Class Reference

Receive events from UDP or Multicast and push them to a "local" EC. NOT THREAD-SAFE. More...

#include <ECG_UDP_Receiver.h>

Inheritance diagram for TAO_ECG_UDP_Receiver:

Inheritance graph
Collaboration diagram for TAO_ECG_UDP_Receiver:

Collaboration graph
List of all members.
 ~TAO_ECG_UDP_Receiver (void)
void init (RtecEventChannelAdmin::EventChannel_ptr lcl_ec, TAO_ECG_Refcounted_Endpoint ignore_from, RtecUDPAdmin::AddrServer_ptr addr_server ACE_ENV_ARG_DECL)
void connect (const RtecEventChannelAdmin::SupplierQOS &pub ACE_ENV_ARG_DECL)
 Connect or reconnect to the EC with the given publications.
void set_handler_shutdown (TAO_ECG_Refcounted_Handler handler_shutdown_rptr)
void shutdown (ACE_ENV_SINGLE_ARG_DECL)
static TAO_EC_Servant_Var<
create (CORBA::Boolean perform_crc=0)
 Initialization and termination methods.

Public Member Functions

void get_addr (const RtecEventComm::EventHeader &header, RtecUDPAdmin::UDP_Addr_out addr ACE_ENV_ARG_DECL)
virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL) throw (CORBA::SystemException)
virtual int handle_input (ACE_SOCK_Dgram &dgram)
 TAO_ECG_Dgram_Handler method.

Protected Member Functions

 TAO_ECG_UDP_Receiver (CORBA::Boolean perform_crc=0)

Private Types

typedef TAO_EC_Auto_Command<

Private Member Functions

void new_connect (const RtecEventChannelAdmin::SupplierQOS &pub ACE_ENV_ARG_DECL)
 Helpers for the connect() method.
void reconnect (const RtecEventChannelAdmin::SupplierQOS &pub ACE_ENV_ARG_DECL)
 Helpers for the connect() method.

Private Attributes

RtecEventChannelAdmin::EventChannel_var lcl_ec_
 Event Channel to which we act as a supplier.
RtecUDPAdmin::AddrServer_var addr_server_
 The server used to map event types to multicast groups.
RtecEventChannelAdmin::ProxyPushConsumer_var consumer_proxy_
 Proxy used to supply events to the Event Channel.
TAO_ECG_CDR_Message_Receiver cdr_receiver_
TAO_ECG_Refcounted_Handler handler_rptr_
ECG_Receiver_Auto_Proxy_Disconnect auto_proxy_disconnect_
 Manages our connection to Consumer Proxy.

Detailed Description

Receive events from UDP or Multicast and push them to a "local" EC. NOT THREAD-SAFE.

This class connects as a supplier to an EventChannel, and supplies to it all events it receives via UDP or Multicast.

Member Typedef Documentation

typedef TAO_EC_Auto_Command<TAO_ECG_UDP_Receiver_Disconnect_Command> TAO_ECG_UDP_Receiver::ECG_Receiver_Auto_Proxy_Disconnect [private]

Constructor & Destructor Documentation

TAO_ECG_UDP_Receiver::~TAO_ECG_UDP_Receiver void   ) 

ACE_INLINE TAO_ECG_UDP_Receiver::TAO_ECG_UDP_Receiver CORBA::Boolean  perform_crc = 0  )  [protected]

Constructor (protected). Clients can create new TAO_ECG_UDP_Receiver objects using the static create() method.

Member Function Documentation

void TAO_ECG_UDP_Receiver::connect const RtecEventChannelAdmin::SupplierQOS &pub  ACE_ENV_ARG_DECL  ) 

Connect or reconnect to the EC with the given publications.

If we are already connected to EC and a reconnection is necessary, the EC must have reconnects enabled in order for this method to succeed.

ACE_INLINE TAO_EC_Servant_Var< TAO_ECG_UDP_Receiver > TAO_ECG_UDP_Receiver::create CORBA::Boolean  perform_crc = 0  )  [static]

Initialization and termination methods.

Create a new TAO_ECG_UDP_Receiver object. (Constructor access is restricted to insure that all TAO_ECG_UDP_Receiver objects are heap-allocated.)

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

The PushSupplier idl method. Invokes shutdown (), which may result in the object being deleted, if refcounting is used to manage its lifetime.

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

Accessor. Call the RtecUDPAdmin::AddrServer::get_addr. Throws exception if nill Address Server was specified in init ().

Implements TAO_ECG_Dgram_Handler.

int TAO_ECG_UDP_Receiver::handle_input ACE_SOCK_Dgram dgram  )  [virtual]

TAO_ECG_Dgram_Handler method.

UDP/Multicast Event_Handlers call this method when data is available at the socket - the <dgram> is ready for reading. Data is read from the socket, and, if complete message is received, the event is pushed to the local Event Channel.

Implements TAO_ECG_Dgram_Handler.

void TAO_ECG_UDP_Receiver::init RtecEventChannelAdmin::EventChannel_ptr  lcl_ec,
TAO_ECG_Refcounted_Endpoint  ignore_from,
RtecUDPAdmin::AddrServer_ptr addr_server  ACE_ENV_ARG_DECL

lcl_ec Event Channel to which we will act as a supplier of events.
ignore_from Endpoint used to remove events generated by the same process.
addr_server Address server used to obtain mapping of event type to multicast group. To insure proper resource clean up, if init () is successful, shutdown () must be called when the receiver is no longer needed. This is done by disconnect_push_supplier() method. If disconnect_push_supplier() will not be called, it is the responsibility of the user. Furthermore, if shutdown() is not explicitly called by either disconnect_push_supplier () or the user, the receiver will clean up the resources in its destructor, however, certain entities involved in cleanup must still exist at that point, e.g., POA.

void TAO_ECG_UDP_Receiver::new_connect const RtecEventChannelAdmin::SupplierQOS &pub  ACE_ENV_ARG_DECL  )  [private]

Helpers for the connect() method.

void TAO_ECG_UDP_Receiver::reconnect const RtecEventChannelAdmin::SupplierQOS &pub  ACE_ENV_ARG_DECL  )  [private]

Helpers for the connect() method.

ACE_INLINE void TAO_ECG_UDP_Receiver::set_handler_shutdown TAO_ECG_Refcounted_Handler  handler_shutdown_rptr  ) 

Set the handler we must notify when shutdown occurs. (This is the handler that alerts us when data is available on udp/mcast socket.) Shutdown notification gives the handler an opportunity to properly clean up resources.

void TAO_ECG_UDP_Receiver::shutdown ACE_ENV_SINGLE_ARG_DECL   ) 

If this class is used with refcounting, calling this method may result in decrementing of the reference count (due to deactivation) and deletion of the object.

Member Data Documentation

RtecUDPAdmin::AddrServer_var TAO_ECG_UDP_Receiver::addr_server_ [private]

The server used to map event types to multicast groups.

ECG_Receiver_Auto_Proxy_Disconnect TAO_ECG_UDP_Receiver::auto_proxy_disconnect_ [private]

Manages our connection to Consumer Proxy.

TAO_ECG_CDR_Message_Receiver TAO_ECG_UDP_Receiver::cdr_receiver_ [private]

Helper for reading incoming UDP/Multicast messages. It assembles message fragments and provides access to a cdr stream once the complete message has been received.

RtecEventChannelAdmin::ProxyPushConsumer_var TAO_ECG_UDP_Receiver::consumer_proxy_ [private]

Proxy used to supply events to the Event Channel.

TAO_ECG_Refcounted_Handler TAO_ECG_UDP_Receiver::handler_rptr_ [private]

Handler we must notify when shutdown occurs, so it has an opportunity to clean up resources.

RtecEventChannelAdmin::EventChannel_var TAO_ECG_UDP_Receiver::lcl_ec_ [private]

Event Channel to which we act as a supplier.

The documentation for this class was generated from the following files:
Generated on Wed Nov 23 16:19:19 2005 for TAO_RTEvent by  doxygen 1.4.5