RTC::TcpHandler< DataType > Class Template Reference

TcpHandler class. More...

#include <TcpSockServer.h>

List of all members.

Public Member Functions

 TcpHandler (BufferBase< DataType > &buffer, Properties &prop)
 Constructor.
virtual ~TcpHandler ()
 Virtual destructor.
int open (ACE_Reactor *reactor)
 Start monitoring event.
int close (void)
 Close the event monitoring.
 operator ACE_SOCK_Stream & ()
 Get the socket stream.

Protected Member Functions

ACE_HANDLE get_handle (void) const
 Get the socket stream handle.
int handle_input (ACE_HANDLE)
 Receive data.
int handle_close (ACE_HANDLE, ACE_Reactor_Mask mask)
 Close the socket stream.

Protected Attributes

BufferBase< DataType > & m_buffer
 Buffer assigned to this TCP server.
Propertiesm_prop
 Properties for setting.
char * m_pRecvBuffer
 Buffer for data reception.
long int m_recvBufSize
 Receive data size.
bool m_byteswap
 Byte swap flag.
ACE_SOCK_Stream m_clientStream
 Socket stream handle.
ACE_Reactor * m_reactor
 Reactor.
DataType m_data
 The target data for writing.


Detailed Description

template<class DataType>
class RTC::TcpHandler< DataType >

TcpHandler class.

Event handler class for TCP communication.

Parameters:
DataType Data type of the buffer

Constructor & Destructor Documentation

template<class DataType>
RTC::TcpHandler< DataType >::TcpHandler ( BufferBase< DataType > &  buffer,
Properties prop 
) [inline]

Constructor.

Constructor

Parameters:
buffer Buffer
prop Property information

template<class DataType>
virtual RTC::TcpHandler< DataType >::~TcpHandler (  )  [inline, virtual]

Virtual destructor.


Member Function Documentation

template<class DataType>
int RTC::TcpHandler< DataType >::open ( ACE_Reactor *  reactor  )  [inline]

Start monitoring event.

Register the event handler to the reactor and start monitoring the event for the reactor.

Parameters:
reactor The target reactor
Returns:
Start processing result

template<class DataType>
int RTC::TcpHandler< DataType >::close ( void   )  [inline]

Close the event monitoring.

Close the event handler.

Returns:
Close processing result

template<class DataType>
RTC::TcpHandler< DataType >::operator ACE_SOCK_Stream & (  )  [inline]

Get the socket stream.

Get the specified socket stream.

Returns:
The socket stream

template<class DataType>
ACE_HANDLE RTC::TcpHandler< DataType >::get_handle ( void   )  const [inline, protected]

Get the socket stream handle.

Get the socket stream handle that was set.

Returns:
The socket stream handle

template<class DataType>
int RTC::TcpHandler< DataType >::handle_input ( ACE_HANDLE   )  [inline, protected]

Receive data.

Receive data from the set socket stream handle. When receiving data which is bigger size than the receive buffer, the buffer size is automatically enhanced.

Parameters:
The target handle for data receive
Returns:
Data receive result

template<class DataType>
int RTC::TcpHandler< DataType >::handle_close ( ACE_HANDLE  ,
ACE_Reactor_Mask  mask 
) [inline, protected]

Close the socket stream.

Close the specified socket stream handle, and also close the socket stream itself.

Parameters:
The target handle for the close
mask The target event for the close
Returns:
Close processing result


Member Data Documentation

template<class DataType>
BufferBase<DataType>& RTC::TcpHandler< DataType >::m_buffer [protected]

Buffer assigned to this TCP server.

template<class DataType>
Properties& RTC::TcpHandler< DataType >::m_prop [protected]

Properties for setting.

template<class DataType>
char* RTC::TcpHandler< DataType >::m_pRecvBuffer [protected]

Buffer for data reception.

template<class DataType>
long int RTC::TcpHandler< DataType >::m_recvBufSize [protected]

Receive data size.

template<class DataType>
bool RTC::TcpHandler< DataType >::m_byteswap [protected]

Byte swap flag.

template<class DataType>
ACE_SOCK_Stream RTC::TcpHandler< DataType >::m_clientStream [protected]

Socket stream handle.

template<class DataType>
ACE_Reactor* RTC::TcpHandler< DataType >::m_reactor [protected]

Reactor.

template<class DataType>
DataType RTC::TcpHandler< DataType >::m_data [protected]

The target data for writing.


Generated on Wed May 21 05:17:34 2008 for OpenRTM by  doxygen 1.5.3