channel::TcpSockTransport< Channel > Class Template Reference

transport class for connection using tcp socket More...

#include <TcpSockConnector.h>

List of all members.

Public Types

typedef TcpSockTransport<
Channel
TransportType

Public Member Functions

 TcpSockTransport (Connector *c)
std::string host_addr (void)
int port (void)
Status get_my_ip (std::string &addr)
 get local ip addr
Status get_map_index (ConnInfo &addr)
 return ip addr as the index of conn_map_
Status open (ConnInfo ci)
 start listening at addr(ci) for remote connections
Status close (void)
Status connect (ConnInfo addr, ConnHandler *&conn_handler)
 actively connect to remote channel
Status disconnect (ConnInfo addr)

Static Public Member Functions

static Interface_Type type (void)

Private Types

typedef ConnHandler< Channel,
TcpSockTransport< Channel > > 
ConnHandler
typedef Connector< Channel,
TcpSockTransport< Channel > > 
Connector

Private Attributes

std::string host_addr_
u_short port_
Tcp_Acceptor< Channeltcp_acceptor_
Tcp_Connector< Channeltcp_connector_


Detailed Description

template<class Channel>
class channel::TcpSockTransport< Channel >

transport class for connection using tcp socket

Definition at line 161 of file TcpSockConnector.h.


Member Typedef Documentation

template<class Channel>
typedef Connector<Channel, TcpSockTransport<Channel> > channel::TcpSockTransport< Channel >::Connector [private]
 

Definition at line 163 of file TcpSockConnector.h.

template<class Channel>
typedef ConnHandler<Channel, TcpSockTransport<Channel> > channel::TcpSockTransport< Channel >::ConnHandler [private]
 

Reimplemented in channel::Connector< Channel, TcpSockTransport< Channel > >, and channel::Connector< Channel, TcpSockTransport< Channel > >.

Definition at line 162 of file TcpSockConnector.h.

template<class Channel>
typedef TcpSockTransport<Channel> channel::TcpSockTransport< Channel >::TransportType
 

Definition at line 176 of file TcpSockConnector.h.


Constructor & Destructor Documentation

template<class Channel>
channel::TcpSockTransport< Channel >::TcpSockTransport Connector c  )  [inline]
 

Definition at line 178 of file TcpSockConnector.h.

References channel::TcpSockTransport< Channel >::port_, channel::TcpSockTransport< Channel >::tcp_acceptor_, channel::TcpSockTransport< Channel >::tcp_connector_, and channel::UNDEFINED_TCP_PORT.


Member Function Documentation

template<class Channel>
Status channel::TcpSockTransport< Channel >::close void   )  [inline]
 

Reimplemented in channel::Connector< Channel, TcpSockTransport< Channel > >.

Definition at line 248 of file TcpSockConnector.h.

References channel::SUCCESS, and channel::UNDEFINED_TCP_PORT.

template<class Channel>
Status channel::TcpSockTransport< Channel >::connect ConnInfo  addr,
ConnHandler *&  conn_handler
[inline]
 

actively connect to remote channel

Definition at line 256 of file TcpSockConnector.h.

References channel::ConnInfo::dump(), channel::FAILURE, channel::ConnInfo::ip(), channel::ConnInfo::port(), and channel::SUCCESS.

template<class Channel>
Status channel::TcpSockTransport< Channel >::disconnect ConnInfo  addr  )  [inline]
 

Definition at line 275 of file TcpSockConnector.h.

References channel::SUCCESS.

template<class Channel>
Status channel::TcpSockTransport< Channel >::get_map_index ConnInfo addr  )  [inline]
 

return ip addr as the index of conn_map_

Definition at line 211 of file TcpSockConnector.h.

References channel::FAILURE, channel::ConnInfo::get_host_addr(), channel::TcpSockTransport< Channel >::get_my_ip(), channel::ConnInfo::ip(), channel::ConnInfo::port(), and channel::SUCCESS.

template<class Channel>
Status channel::TcpSockTransport< Channel >::get_my_ip std::string &  addr  )  [inline]
 

get local ip addr

Definition at line 191 of file TcpSockConnector.h.

References channel::FAILURE, channel::TcpSockTransport< Channel >::host_addr(), and channel::SUCCESS.

Referenced by channel::TcpSockTransport< Channel >::get_map_index().

template<class Channel>
std::string channel::TcpSockTransport< Channel >::host_addr void   )  [inline]
 

Definition at line 187 of file TcpSockConnector.h.

References channel::TcpSockTransport< Channel >::host_addr_.

Referenced by channel::TcpSockTransport< Channel >::get_my_ip(), and channel::RemoteInterface< Channel, Transport >::send2remote_chan_info().

template<class Channel>
Status channel::TcpSockTransport< Channel >::open ConnInfo  ci  )  [inline]
 

start listening at addr(ci) for remote connections

Definition at line 226 of file TcpSockConnector.h.

References channel::FAILURE, channel::ConnInfo::port(), channel::SUCCESS, and channel::UNDEFINED_TCP_PORT.

template<class Channel>
int channel::TcpSockTransport< Channel >::port void   )  [inline]
 

Definition at line 188 of file TcpSockConnector.h.

References channel::TcpSockTransport< Channel >::port_.

Referenced by channel::RemoteInterface< Channel, Transport >::send2remote_chan_info().

template<class Channel>
static Interface_Type channel::TcpSockTransport< Channel >::type void   )  [inline, static]
 

Reimplemented in channel::Connector< Channel, TcpSockTransport< Channel > >.

Definition at line 184 of file TcpSockConnector.h.

References channel::INET_SOCK.


Member Data Documentation

template<class Channel>
std::string channel::TcpSockTransport< Channel >::host_addr_ [private]
 

Definition at line 167 of file TcpSockConnector.h.

Referenced by channel::TcpSockTransport< Channel >::host_addr().

template<class Channel>
u_short channel::TcpSockTransport< Channel >::port_ [private]
 

Definition at line 168 of file TcpSockConnector.h.

Referenced by channel::TcpSockTransport< Channel >::port(), and channel::TcpSockTransport< Channel >::TcpSockTransport().

template<class Channel>
Tcp_Acceptor<Channel> channel::TcpSockTransport< Channel >::tcp_acceptor_ [private]
 

Definition at line 170 of file TcpSockConnector.h.

Referenced by channel::TcpSockTransport< Channel >::TcpSockTransport().

template<class Channel>
Tcp_Connector<Channel> channel::TcpSockTransport< Channel >::tcp_connector_ [private]
 

Definition at line 172 of file TcpSockConnector.h.

Referenced by channel::TcpSockTransport< Channel >::TcpSockTransport().


The documentation for this class was generated from the following file:
Generated on Mon Feb 27 19:59:24 2006 for channel by  doxygen 1.4.6-NO