TAO_RTEvent
2.2.0
|
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. More... | |
Public Member Functions inherited from TAO_EC_Deactivated_Object | |
void | set_deactivator (TAO_EC_Object_Deactivator &deactivator) |
Public Member Functions inherited from TAO_ECG_Dgram_Handler | |
virtual | ~TAO_ECG_Dgram_Handler (void) |
Protected Member Functions | |
TAO_ECG_UDP_Receiver (CORBA::Boolean perform_crc=false) | |
Protected Member Functions inherited from TAO_EC_Deactivated_Object | |
TAO_EC_Deactivated_Object (void) | |
~TAO_EC_Deactivated_Object (void) | |
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. More... | |
void | reconnect (const RtecEventChannelAdmin::SupplierQOS &pub) |
Helpers for the connect() method. More... | |
Private Attributes | |
RtecEventChannelAdmin::EventChannel_var | lcl_ec_ |
Event Channel to which we act as a supplier. More... | |
RtecUDPAdmin::AddrServer_var | addr_server_ |
The server used to map event types to multicast groups. More... | |
RtecEventChannelAdmin::ProxyPushConsumer_var | consumer_proxy_ |
Proxy used to supply events to the Event Channel. More... | |
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. More... | |
static PortableServer::Servant_var < TAO_ECG_UDP_Receiver > | create (CORBA::Boolean perform_crc=0) |
Initialization and termination methods. More... | |
~TAO_ECG_UDP_Receiver (void) | |
Initialization and termination methods. More... | |
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. More... | |
void | set_handler_shutdown (TAO_ECG_Refcounted_Handler handler_shutdown_rptr) |
void | shutdown (void) |
Additional Inherited Members | |
Protected Attributes inherited from TAO_EC_Deactivated_Object | |
TAO_EC_Object_Deactivator | deactivator_ |
Utility for deactivating ourselves from POA. More... | |
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.
|
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.)
|
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 |
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.)
|
virtual |
The PushSupplier idl method. Invokes shutdown (), which may result in the object being deleted, if refcounting is used to manage its lifetime.
|
virtual |
Accessor. Call the RtecUDPAdmin::AddrServer::get_addr. Throws exception if nil Address Server was specified in init ().
Implements TAO_ECG_Dgram_Handler.
|
virtual |
Call the RtecUDPAdmin::AddrServer::get_address. Throws exception if nil Address Server was specified in init ().
Implements TAO_ECG_Dgram_Handler.
|
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. |
|
private |
Helpers for the connect() method.
|
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.
|
private |
The server used to map event types to multicast groups.
|
private |
Manages our connection to Consumer Proxy.
|
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.
|
private |
Proxy used to supply events to the Event Channel.
|
private |
Handler we must notify when shutdown occurs, so it has an opportunity to clean up resources.
|
private |
Event Channel to which we act as a supplier.