TAO_RTEvent
2.0.8
|
Receive events from UDP or Multicast and push them to a "local" EC. NOT THREAD-SAFE. More...
#include <ECG_UDP_Receiver.h>
Public Member Functions | |
void | get_addr (const RtecEventComm::EventHeader &header, RtecUDPAdmin::UDP_Addr_out addr) |
void | get_address (const RtecEventComm::EventHeader &header, RtecUDPAdmin::UDP_Address_out addr) |
virtual void | disconnect_push_supplier (void) |
virtual int | handle_input (ACE_SOCK_Dgram &dgram) |
TAO_ECG_Dgram_Handler method. | |
Protected Member Functions | |
TAO_ECG_UDP_Receiver (CORBA::Boolean perform_crc=false) | |
Private Types | |
typedef TAO_EC_Auto_Command < TAO_ECG_UDP_Receiver_Disconnect_Command > | ECG_Receiver_Auto_Proxy_Disconnect |
Private Member Functions | |
void | new_connect (const RtecEventChannelAdmin::SupplierQOS &pub) |
Helpers for the connect() method. | |
void | reconnect (const RtecEventChannelAdmin::SupplierQOS &pub) |
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. | |
static PortableServer::Servant_var < TAO_ECG_UDP_Receiver > | create (CORBA::Boolean perform_crc=0) |
Initialization and termination methods. | |
~TAO_ECG_UDP_Receiver (void) | |
Initialization and termination methods. | |
void | init (RtecEventChannelAdmin::EventChannel_ptr lcl_ec, TAO_ECG_Refcounted_Endpoint ignore_from, RtecUDPAdmin::AddrServer_ptr addr_server) |
void | connect (const RtecEventChannelAdmin::SupplierQOS &pub) |
Connect or reconnect to the EC with the given publications. | |
void | set_handler_shutdown (TAO_ECG_Refcounted_Handler handler_shutdown_rptr) |
void | shutdown (void) |
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.
typedef TAO_EC_Auto_Command<TAO_ECG_UDP_Receiver_Disconnect_Command> TAO_ECG_UDP_Receiver::ECG_Receiver_Auto_Proxy_Disconnect [private] |
TAO_ECG_UDP_Receiver::~TAO_ECG_UDP_Receiver | ( | void | ) |
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.)
TAO_ECG_UDP_Receiver::TAO_ECG_UDP_Receiver | ( | CORBA::Boolean | perform_crc = false | ) | [protected] |
Constructor (protected). Clients can create new TAO_ECG_UDP_Receiver objects using the static create() method.
void TAO_ECG_UDP_Receiver::connect | ( | const RtecEventChannelAdmin::SupplierQOS & | pub | ) |
Connect or reconnect to the EC with the given publications.
static PortableServer::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 | ( | void | ) | [virtual] |
The PushSupplier idl method. Invokes shutdown (), which may result in the object being deleted, if refcounting is used to manage its lifetime.
void TAO_ECG_UDP_Receiver::get_addr | ( | const RtecEventComm::EventHeader & | header, |
RtecUDPAdmin::UDP_Addr_out | addr | ||
) | [virtual] |
Accessor. Call the RtecUDPAdmin::AddrServer::get_addr. Throws exception if nil Address Server was specified in init ().
Implements TAO_ECG_Dgram_Handler.
void TAO_ECG_UDP_Receiver::get_address | ( | const RtecEventComm::EventHeader & | header, |
RtecUDPAdmin::UDP_Address_out | addr | ||
) | [virtual] |
Call the RtecUDPAdmin::AddrServer::get_address. Throws exception if nil 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 | ||
) |
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 | ) | [private] |
Helpers for the connect() method.
void TAO_ECG_UDP_Receiver::reconnect | ( | const RtecEventChannelAdmin::SupplierQOS & | pub | ) | [private] |
Helpers for the connect() method.
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 | ( | void | ) |
Deactivate from POA and disconnect from EC, if necessary. Shut down all receiver components. 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.
RtecUDPAdmin::AddrServer_var TAO_ECG_UDP_Receiver::addr_server_ [private] |
The server used to map event types to multicast groups.
Manages our connection to Consumer Proxy.
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.
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.