Public Member Functions | Protected Attributes

TAO_AV_TCP_Flow_Handler Class Reference

#include <TCP.h>

Inheritance diagram for TAO_AV_TCP_Flow_Handler:
Inheritance graph
[legend]
Collaboration diagram for TAO_AV_TCP_Flow_Handler:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 TAO_AV_TCP_Flow_Handler (TAO_AV_Callback *callback=0)
virtual ~TAO_AV_TCP_Flow_Handler (void)
virtual TAO_AV_Transporttransport (void)
virtual int open (void *=0)
virtual int handle_input (ACE_HANDLE fd)
virtual int handle_timeout (const ACE_Time_Value &tv, const void *arg=0)
virtual ACE_Event_Handlerevent_handler (void)

Protected Attributes

TAO_AV_Coreav_core_

Detailed Description

Definition at line 105 of file TCP.h.


Constructor & Destructor Documentation

TAO_AV_TCP_Flow_Handler::TAO_AV_TCP_Flow_Handler ( TAO_AV_Callback callback = 0  ) 

Definition at line 625 of file TCP.cpp.

      :TAO_AV_Flow_Handler (callback)
{
  ACE_NEW (this->transport_,
           TAO_AV_TCP_Transport (this));
}

TAO_AV_TCP_Flow_Handler::~TAO_AV_TCP_Flow_Handler ( void   )  [virtual]

Definition at line 632 of file TCP.cpp.

{
  delete this->transport_;
}


Member Function Documentation

virtual ACE_Event_Handler* TAO_AV_TCP_Flow_Handler::event_handler ( void   )  [inline, virtual]

Definition at line 116 of file TCP.h.

{ return this; }

int TAO_AV_TCP_Flow_Handler::handle_input ( ACE_HANDLE  fd  )  [virtual]

Definition at line 698 of file TCP.cpp.

{
  return this->protocol_object_->handle_input ();
}

int TAO_AV_TCP_Flow_Handler::handle_timeout ( const ACE_Time_Value tv,
const void *  arg = 0 
) [virtual]

Reimplemented from ACE_Svc_Handler< ACE_SOCK_STREAM, ACE_NULL_SYNCH >.

Definition at line 704 of file TCP.cpp.

int TAO_AV_TCP_Flow_Handler::open ( void *  = 0  )  [virtual]

Reimplemented from ACE_Svc_Handler< ACE_SOCK_STREAM, ACE_NULL_SYNCH >.

Definition at line 644 of file TCP.cpp.

{

#if defined (TCP_NODELAY)
  int nodelay = 1;

  if (this->peer ().set_option (IPPROTO_TCP,
                                TCP_NODELAY,
                                (void *) &nodelay,
                                sizeof (nodelay)) == -1)
    ACE_ERROR_RETURN ((LM_ERROR,
                       "NODELAY failed\n"),
                      -1);
#endif /* TCP_NODELAY */

  int buf_size = BUFSIZ;
  int s = sizeof (buf_size);
  if (this->peer ().get_option (SOL_SOCKET, /*IPPROTO_TCP,*/
                                SO_RCVBUF,
                                (void *) &buf_size, &s) == -1)
       buf_size = BUFSIZ;
    
    ((TAO_AV_TCP_Object*)(this->protocol_object_))->frame_.size (buf_size);

  // Called by the <Strategy_Acceptor> when the handler is completely
  // connected.
  ACE_INET_Addr addr;

  if (this->peer ().get_remote_addr (addr) == -1)
    return -1;

  ACE_TCHAR server[MAXHOSTNAMELEN + 16];

  (void) addr.addr_to_string (server, sizeof (server));

  if (TAO_debug_level > 0)
    if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,
                "(%P|%t) connection to server <%s> on %d\n",
                server, this->peer ().get_handle ()));

  this->peer ().enable (ACE_NONBLOCK);
  // Register the handler with the reactor.
  if (this->reactor ()
      && this->reactor ()->register_handler
      (this,
       ACE_Event_Handler::READ_MASK) == -1)
    ACE_ERROR_RETURN ((LM_ERROR,
                       ACE_TEXT ("%p\n"),
                       ACE_TEXT ("unable to register client handler")),
                      -1);
  return 0;
}

TAO_AV_Transport * TAO_AV_TCP_Flow_Handler::transport ( void   )  [virtual]

Definition at line 638 of file TCP.cpp.

{
  return this->transport_;
}


Member Data Documentation

Definition at line 118 of file TCP.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines