| 
    TAO 3.0.6
    
   | 
 
TAO_Connection_Handler. More...
#include <Connection_Handler.h>


Public Member Functions | |
| TAO_Connection_Handler (TAO_ORB_Core *orb_core) | |
| Constructor.  More... | |
| virtual | ~TAO_Connection_Handler (void) | 
| Destructor.  More... | |
| TAO_Transport * | transport (void) | 
| Return the underlying transport object.  More... | |
| void | transport (TAO_Transport *transport) | 
| Set the underlying transport object.  More... | |
| bool | is_closed () const | 
| Is the handler closed or timed out?  More... | |
| bool | is_open () const | 
| Is the handler open?  More... | |
| bool | is_timeout () const | 
| Closed due to timeout?  More... | |
| bool | is_connecting () const | 
| Is the handler in the process of being connected?  More... | |
| virtual int | close_connection (void)=0 | 
| Close the underlying connection.  More... | |
| virtual int | handle_input (ACE_HANDLE fd)=0 | 
| int | svc_i (void) | 
| virtual int | open_handler (void *)=0 | 
| A open () hook.  More... | |
| virtual int | close_handler (u_long flags=0) | 
| void | connection_pending (void) | 
| void | cancel_pending_connection (void) | 
| virtual int | set_dscp_codepoint (CORBA::Boolean set_network_priority) | 
| virtual int | set_dscp_codepoint (CORBA::Long dscp_codepoint) | 
| virtual int | release_os_resources (void) | 
| Release the OS resources related to this handler.  More... | |
| virtual int | handle_write_ready (const ACE_Time_Value *timeout) | 
  Public Member Functions inherited from TAO_LF_CH_Event | |
| TAO_LF_CH_Event (void) | |
| Constructor.  More... | |
| virtual | ~TAO_LF_CH_Event (void) | 
| Destructor.  More... | |
  Public Member Functions inherited from TAO_LF_Event | |
| TAO_LF_Event (void) | |
| Constructor.  More... | |
| virtual | ~TAO_LF_Event (void) | 
| Destructor.  More... | |
| void | state_changed (LFS_STATE new_state, TAO_Leader_Follower &lf) | 
| bool | successful (TAO_Leader_Follower &lf) const | 
| bool | error_detected (TAO_Leader_Follower &lf) const | 
| bool | keep_waiting (TAO_Leader_Follower &lf) const | 
| Check if we should keep waiting.  More... | |
| void | reset_state (LFS_STATE new_state) | 
| Reset the state, irrespective of the previous states.  More... | |
Protected Member Functions | |
| TAO_ORB_Core * | orb_core (void) | 
| Return our TAO_ORB_Core pointer.  More... | |
| int | shared_open (void) | 
| int | set_socket_option (ACE_SOCK &sock, int snd_size, int rcv_size) | 
| Set options on the socket.  More... | |
  Protected Member Functions inherited from TAO_LF_CH_Event | |
| virtual bool | is_state_final () const | 
| Check whether we have reached the final state..  More... | |
  Protected Member Functions inherited from TAO_LF_Event | |
| bool | keep_waiting_i () const | 
| Check if we should keep waiting.  More... | |
Helper methods for Event_Handler-based derived classes. | |
Many (actually all so far) implementations of TAO_Connection_Handler are a mixin of TAO_Connection_Handler and some form of ACE_Event_Handler. The following methods simplify such implementations by capturing the common code in a single place.  | |
| TAO_ORB_Core *const | orb_core_ | 
| Pointer to the TAO_ORB_Core.  More... | |
| TAO_Transport * | transport_ | 
| Transport object reference.  More... | |
| bool | connection_pending_ | 
| Stores the connection pending state.  More... | |
| bool | is_closed_ | 
| int | handle_output_eh (ACE_HANDLE h, ACE_Event_Handler *eh) | 
| Implement the handle_output() callback.  More... | |
| int | handle_input_eh (ACE_HANDLE h, ACE_Event_Handler *eh) | 
| Implement the handle_input() callback.  More... | |
| int | handle_input_internal (ACE_HANDLE h, ACE_Event_Handler *eh) | 
| Pointer to the TAO_ORB_Core.  More... | |
| int | close_connection_eh (ACE_Event_Handler *eh) | 
| virtual void | pre_io_hook (int &return_value) | 
| virtual void | pos_io_hook (int &return_value) | 
| TAO_Connection_Handler (const TAO_Connection_Handler &)=delete | |
| Pointer to the TAO_ORB_Core.  More... | |
| TAO_Connection_Handler & | operator= (const TAO_Connection_Handler &)=delete | 
| Pointer to the TAO_ORB_Core.  More... | |
Additional Inherited Members | |
  Public Types inherited from TAO_LF_Event | |
| enum | LFS_STATE {  LFS_IDLE = 0 , LFS_ACTIVE , LFS_CONNECTION_WAIT , LFS_SUCCESS , LFS_FAILURE , LFS_TIMEOUT , LFS_CONNECTION_CLOSED }  | 
| The current state.  More... | |
  Static Public Member Functions inherited from TAO_LF_Event | |
| static const char * | state_name (LFS_STATE st) | 
| The current state.  More... | |
  Protected Attributes inherited from TAO_LF_Event | |
| LFS_STATE | state_ | 
| The current state.  More... | |
| TAO_LF_Follower * | follower_ | 
| The bounded follower.  More... | |
This class is an abstraction for the connection handlers. The connections handler in every protocol can derive from this class as well as the ACE_Svc_Handler specialised for the right protocol. This way, most of the common code for the different protocols would be in this implementation.
      
  | 
  explicit | 
Constructor.
      
  | 
  virtual | 
Destructor.
      
  | 
  privatedelete | 
Pointer to the TAO_ORB_Core.
| void TAO_Connection_Handler::cancel_pending_connection | ( | void | ) | 
A pending connection may be canceled due to an error detected while the initiating thread is still in the Connector.
      
  | 
  pure virtual | 
Close the underlying connection.
Used by the ORB to actively close connections that are idle, stale or somehow are determined to be broken before the Reactor does.
Implemented in TAO_IIOP_Connection_Handler.
      
  | 
  protected | 
Implement close_connection() for Connection_Handlers that are also Event_Handlers.
      
  | 
  virtual | 
A close() hook, called by the Transport Connector when they want to close this handler
| void TAO_Connection_Handler::connection_pending | ( | void | ) | 
When waiting for an asynchronous connection to complete an additional reference must be maintained, related to bugzilla #2417. However once the connection is successfully established, this reference must be removed. Using connection_pending allows the connection handler to know that it is opening as a result of a delayed asynch connection rather than an immediate synch connection, which has no additional reference needs.
      
  | 
  pure virtual | 
The event handler calls, here so that other objects who hold a reference to this object can call the event handler methods.
Implemented in TAO_IIOP_Connection_Handler.
      
  | 
  protected | 
Implement the handle_input() callback.
      
  | 
  protected | 
Pointer to the TAO_ORB_Core.
      
  | 
  protected | 
Implement the handle_output() callback.
      
  | 
  virtual | 
Derived classes should implement this for proper support with the Blocking Flushing Strategy.
Reimplemented in TAO_IIOP_Connection_Handler.
| bool TAO_Connection_Handler::is_closed | ( | ) | const | 
Is the handler closed or timed out?
| bool TAO_Connection_Handler::is_connecting | ( | ) | const | 
Is the handler in the process of being connected?
| bool TAO_Connection_Handler::is_open | ( | ) | const | 
Is the handler open?
| bool TAO_Connection_Handler::is_timeout | ( | ) | const | 
Closed due to timeout?
      
  | 
  pure virtual | 
A open () hook.
See Thread_Per_Connection_Handler for a use case
Implemented in TAO_IIOP_Connection_Handler.
      
  | 
  privatedelete | 
Pointer to the TAO_ORB_Core.
      
  | 
  protected | 
Return our TAO_ORB_Core pointer.
      
  | 
  protectedvirtual | 
Post-invocation hook for I/O operations (handle_input() & handle_output()) See the SSLIOP protocol for an interesting use-case
      
  | 
  protectedvirtual | 
Pre-invocation hook for I/O operations (handle_input() & handle_output()) See the SSLIOP protocol for an interesting use-case
      
  | 
  virtual | 
Release the OS resources related to this handler.
Reimplemented in TAO_IIOP_Connection_Handler.
      
  | 
  virtual | 
Set the Diff-Serv codepoint on outgoing packets. Only has effect for remote protocols (e.g., IIOP); no effect for local protocols (UIOP). Default implementation is for local protocols. Remote protocols must overwrite implementation.
Reimplemented in TAO_IIOP_Connection_Handler.
      
  | 
  virtual | 
Reimplemented in TAO_IIOP_Connection_Handler.
      
  | 
  protected | 
Set options on the socket.
      
  | 
  protected | 
A common function called at the start of any protocol-specific open. Returns -1 on a failure (although no failure mode is currently defined).
| int TAO_Connection_Handler::svc_i | ( | void | ) | 
This method is invoked from the svc () method of the Svc_Handler Object.
| void TAO_Connection_Handler::transport | ( | TAO_Transport * | transport | ) | 
Set the underlying transport object.
| TAO_Transport * TAO_Connection_Handler::transport | ( | void | ) | 
Return the underlying transport object.
      
  | 
  private | 
Stores the connection pending state.
      
  | 
  private | 
Once closed make sure the transport is not added back to the cache. This is distinct from the leader-follower state so it cannot be reset.
      
  | 
  private | 
Pointer to the TAO_ORB_Core.
      
  | 
  private | 
Transport object reference.