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

# TAO_ECG_Mcast_EH Class Reference

Event Handler for UDP messages. More...

`#include <EC_Gateway_UDP.h>`

Inheritance diagram for TAO_ECG_Mcast_EH

[legend]
Collaboration diagram for TAO_ECG_Mcast_EH:

[legend]
List of all members.

## Public Methods
| TAO_ECG_Mcast_EH (TAO_ECG_UDP_Receiver *recv, const ACE_TCHAR *net_if = 0)
virtual | ~TAO_ECG_Mcast_EH (void)
| Destructor.
int | open (RtecEventChannelAdmin::EventChannel_ptr ec, CORBA::Environment &env = TAO_default_environment ())
int | close (CORBA::Environment &env = TAO_default_environment ())
ACE_SOCK_Dgram& | dgram (void)
virtual int | handle_input (ACE_HANDLE fd)
| Reactor callbacks.
virtual ACE_HANDLE | get_handle (void) const
void | update_consumer (const RtecEventChannelAdmin::ConsumerQOS& sub, CORBA::Environment &env = TAO_default_environment ()) throw (CORBA::SystemException)
| The Observer methods.
void | update_supplier (const RtecEventChannelAdmin::SupplierQOS& pub, CORBA::Environment &env = TAO_default_environment ()) throw (CORBA::SystemException)
## Private Methods
int | subscribe (const ACE_INET_Addr &mcast_addr)
| Control the multicast group subscriptions.
int | unsubscribe (const ACE_INET_Addr &mcast_addr)
## Private Attributes
ACE_TCHAR* | net_if_
| The NIC name used to subscribe for multicast traffic.
ACE_SOCK_Dgram_Mcast | dgram_
| The datagram used to receive the data.
TAO_ECG_UDP_Receiver* | receiver_
| We callback to this object when a message arrives.
Observer | observer_
| This object will call us back when the subscription list changes.
RtecEventChannelAdmin::Observer_Handle | handle_
| Keep the handle of the observer so we can unregister later.
RtecEventChannelAdmin::EventChannel_var | ec_
| The Event Channel.

## Detailed Description

Event Handler for UDP messages.

This object receives callbacks from the Reactor when data is available on the mcast socket, it forwards to the UDP_Receive gateway which reads the events and transform it into an event.

## Constructor & Destructor Documentation

TAO_ECG_Mcast_EH::TAO_ECG_Mcast_EH ( | TAO_ECG_UDP_Receiver * recv,
| const ACE_TCHAR * net_if = 0 )

| Constructor, the messages received by this EH are forwarded to the <recv>. It is possible to select the NIC where the multicast messages are expected using <net_if>

TAO_ECG_Mcast_EH::~TAO_ECG_Mcast_EH ( | void )`[virtual]`

| Destructor.

## Member Function Documentation

int TAO_ECG_Mcast_EH::close ( | CORBA::Environment & env = TAO_default_environment () )

| Remove ourselves from the event channel, unsubscribe from the multicast groups, close the sockets and unsubscribe from the reactor.

ACE_INLINE ACE_SOCK_Dgram & TAO_ECG_Mcast_EH::dgram ( | void )

| Obtain the dgram, this is one of those "controlled violations of type safety", allowing the user to setup options and gain access to low-level features.

ACE_HANDLE TAO_ECG_Mcast_EH::get_handle ( | void ) const`[virtual]`

| Reimplemented from ACE_Event_Handler.

int TAO_ECG_Mcast_EH::handle_input ( | ACE_HANDLE fd )`[virtual]`

| Reactor callbacks. Reimplemented from ACE_Event_Handler.

int TAO_ECG_Mcast_EH::open ( | RtecEventChannelAdmin::EventChannel_ptr ec,
| CORBA::Environment & env = TAO_default_environment () )

| Register for changes in the EC subscription list. When the subscription list becomes non-empty we join the proper multicast groups (using the receiver to translate between event types and mcast groups) and the class registers itself with the reactor.

int TAO_ECG_Mcast_EH::subscribe ( | const ACE_INET_Addr & mcast_addr )`[private]`

| Control the multicast group subscriptions.

int TAO_ECG_Mcast_EH::unsubscribe ( | const ACE_INET_Addr & mcast_addr )`[private]`

void TAO_ECG_Mcast_EH::update_consumer ( | const RtecEventChannelAdmin::ConsumerQOS & sub,
| CORBA::Environment & env = TAO_default_environment () ) throw (CORBA::SystemException)

| The Observer methods.

void TAO_ECG_Mcast_EH::update_supplier ( | const RtecEventChannelAdmin::SupplierQOS & pub,
| CORBA::Environment & env = TAO_default_environment () ) throw (CORBA::SystemException)

## Member Data Documentation

ACE_SOCK_Dgram_Mcast TAO_ECG_Mcast_EH::dgram_`[private]`

| The datagram used to receive the data.

RtecEventChannelAdmin::EventChannel_var TAO_ECG_Mcast_EH::ec_`[private]`

| The Event Channel.

RtecEventChannelAdmin::Observer_Handle TAO_ECG_Mcast_EH::handle_`[private]`

| Keep the handle of the observer so we can unregister later.

ACE_TCHAR * TAO_ECG_Mcast_EH::net_if_`[private]`

| The NIC name used to subscribe for multicast traffic.

Observer TAO_ECG_Mcast_EH::observer_`[private]`

| This object will call us back when the subscription list changes.

TAO_ECG_UDP_Receiver * TAO_ECG_Mcast_EH::receiver_`[private]`

| We callback to this object when a message arrives.

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

- EC_Gateway_UDP.h
- EC_Gateway_UDP.cpp
- EC_Gateway_UDP.i