TAO_RTEvent
2.0.8
|
Event Handler for UDP messages. More...
#include <ECG_UDP_EH.h>
Public Member Functions | |
virtual int | handle_input (ACE_HANDLE fd) |
ACE_SOCK_Dgram & | dgram (void) |
TAO_ECG_UDP_EH (TAO_ECG_Dgram_Handler *recv) | |
Initialization and termination methods. | |
virtual | ~TAO_ECG_UDP_EH (void) |
Destructor. | |
int | open (const ACE_INET_Addr &ipaddr, int reuse_addr=0) |
virtual int | shutdown (void) |
Private Attributes | |
ACE_SOCK_Dgram | dgram_ |
The datagram used to receive the data. | |
TAO_ECG_Dgram_Handler * | receiver_ |
We callback to this object when a message arrives. |
Event Handler for UDP messages.
Listens for messages on a UDP socket. When there is a message, calls handle_input () on a specified TAO_ECG_Dgram_Handler to inform it about message arrival.
NOT THREAD-SAFE.
TAO_ECG_UDP_EH::TAO_ECG_UDP_EH | ( | TAO_ECG_Dgram_Handler * | recv | ) |
Initialization and termination methods.
Constructor. Messages received by this EH will be forwarded to the <recv>.
TAO_ECG_UDP_EH::~TAO_ECG_UDP_EH | ( | void | ) | [virtual] |
Destructor.
ACE_SOCK_Dgram& TAO_ECG_UDP_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.
int TAO_ECG_UDP_EH::handle_input | ( | ACE_HANDLE | fd | ) | [virtual] |
Main method - reactor callback. Notify <receiver_> that <dgram_> is ready for reading.
Reimplemented from ACE_Event_Handler.
int TAO_ECG_UDP_EH::open | ( | const ACE_INET_Addr & | ipaddr, |
int | reuse_addr = 0 |
||
) |
Open the datagram and register itself with this->reactor(). To insure proper resource clean up, if open () is successful, the user MUST call shutdown () when handler is no longer needed (and its reactor still exists).
int TAO_ECG_UDP_EH::shutdown | ( | void | ) | [virtual] |
TAO_ECG_Handler_Shutdown method. Unsubscribe from the reactor and close the datagram.
Implements TAO_ECG_Handler_Shutdown.
ACE_SOCK_Dgram TAO_ECG_UDP_EH::dgram_ [private] |
The datagram used to receive the data.
TAO_ECG_Dgram_Handler* TAO_ECG_UDP_EH::receiver_ [private] |
We callback to this object when a message arrives.