OpenDDS::DCPS::SimpleTcpTransport Class Reference

#include <SimpleTcpTransport.h>

Inheritance diagram for OpenDDS::DCPS::SimpleTcpTransport:

Inheritance graph
[legend]
Collaboration diagram for OpenDDS::DCPS::SimpleTcpTransport:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SimpleTcpTransport ()
virtual ~SimpleTcpTransport ()
SimpleTcpConfigurationget_configuration ()
int fresh_link (const ACE_INET_Addr &remote_addr, SimpleTcpConnection_rch connection)

Protected Member Functions

virtual DataLinkfind_or_create_datalink (const TransportInterfaceInfo &remote_info, int connect_as_publisher)
virtual int configure_i (TransportConfiguration *config)
virtual void shutdown_i ()
virtual void pre_shutdown_i ()
virtual int connection_info_i (TransportInterfaceInfo &local_info) const
virtual void release_datalink_i (DataLink *link)
 Called by the DataLink to release itself.

Private Types

typedef ACE_Hash_Map_Manager_Ex<
ACE_INET_Addr, SimpleTcpDataLink_rch,
ACE_Hash< ACE_INET_Addr >,
ACE_Equal_To< ACE_INET_Addr >,
ACE_Null_Mutex > 
AddrLinkMap
 Map Type: (key) ACE_INET_Addr to (value) SimpleTcpDataLink_rch.
typedef ACE_Hash_Map_Manager_Ex<
ACE_INET_Addr, SimpleTcpConnection_rch,
ACE_Hash< ACE_INET_Addr >,
ACE_Equal_To< ACE_INET_Addr >,
ACE_Null_Mutex > 
AddrConnectionMap
 Map Type: (key) ACE_INET_Addr to (value) SimpleTcpConnection_rch.
typedef ACE_SYNCH_MUTEX LockType
typedef ACE_Guard< LockTypeGuardType
typedef ACE_Condition< LockTypeConditionType

Private Member Functions

void passive_connection (const ACE_INET_Addr &remote_address, SimpleTcpConnection *connection)
int make_active_connection (const ACE_INET_Addr &remote_address, SimpleTcpDataLink *link)
 Called by find_or_create_datalink().
int make_passive_connection (const ACE_INET_Addr &remote_address, SimpleTcpDataLink *link)
 Called by find_or_create_datalink().
int connect_datalink (SimpleTcpDataLink *link, SimpleTcpConnection *connection)
 Common code used by make_active_connection() and make_passive_connection().

Private Attributes

SimpleTcpAcceptoracceptor_
 Used to accept passive connections on our local_address_.
SimpleTcpConfiguration_rch tcp_config_
 Our configuration object, supplied to us in config_i().
AddrLinkMap links_
 This is the map of connected DataLinks.
LockType links_lock_
 This lock is used to protect the links_ data member.
AddrConnectionMap connections_
ConditionType connections_updated_
LockType connections_lock_
TransportReactorTask_rch reactor_task_
 We need the reactor for our Acceptor.
SimpleTcpConnectionReplaceTaskcon_checker_

Friends

class SimpleTcpConnection
class SimpleTcpDataLink

Detailed Description

This class provides the "SimpleTcp" transport specific implementation. It creates the acceptor for listening the incoming requests using TCP and maintains a collection of TCP specific connections/datalinks.

Notes about object ownership: 1) Own the datalink objects, passive connection objects, acceptor object and SimpleTcpConnectionReplaceTask object(used during reconnecting). 2) Reference to TransportReactorTask object owned by base class.


Member Typedef Documentation

typedef ACE_Hash_Map_Manager_Ex<ACE_INET_Addr, SimpleTcpConnection_rch, ACE_Hash<ACE_INET_Addr>, ACE_Equal_To<ACE_INET_Addr>, ACE_Null_Mutex> OpenDDS::DCPS::SimpleTcpTransport::AddrConnectionMap [private]

Map Type: (key) ACE_INET_Addr to (value) SimpleTcpConnection_rch.

typedef ACE_Hash_Map_Manager_Ex<ACE_INET_Addr, SimpleTcpDataLink_rch, ACE_Hash<ACE_INET_Addr>, ACE_Equal_To<ACE_INET_Addr>, ACE_Null_Mutex> OpenDDS::DCPS::SimpleTcpTransport::AddrLinkMap [private]

Map Type: (key) ACE_INET_Addr to (value) SimpleTcpDataLink_rch.

typedef ACE_Condition<LockType> OpenDDS::DCPS::SimpleTcpTransport::ConditionType [private]

typedef ACE_Guard<LockType> OpenDDS::DCPS::SimpleTcpTransport::GuardType [private]

Reimplemented from OpenDDS::DCPS::TransportImpl.

typedef ACE_SYNCH_MUTEX OpenDDS::DCPS::SimpleTcpTransport::LockType [private]

Reimplemented from OpenDDS::DCPS::TransportImpl.


Constructor & Destructor Documentation

OpenDDS::DCPS::SimpleTcpTransport::SimpleTcpTransport (  ) 

OpenDDS::DCPS::SimpleTcpTransport::~SimpleTcpTransport (  )  [virtual]


Member Function Documentation

int OpenDDS::DCPS::SimpleTcpTransport::configure_i ( TransportConfiguration config  )  [protected, virtual]

Concrete subclass gets a shot at the config object. The subclass will likely downcast the TransportConfiguration object to a subclass type that it expects/requires.

Implements OpenDDS::DCPS::TransportImpl.

int OpenDDS::DCPS::SimpleTcpTransport::connect_datalink ( SimpleTcpDataLink link,
SimpleTcpConnection connection 
) [private]

Common code used by make_active_connection() and make_passive_connection().

Code common to make_active_connection() and make_passive_connection().

int OpenDDS::DCPS::SimpleTcpTransport::connection_info_i ( TransportInterfaceInfo local_info  )  const [protected, virtual]

Called by our connection_info() method to allow the concrete TransportImpl subclass to do the dirty work since it really is the one that knows how to populate the supplied TransportInterfaceInfo object.

Implements OpenDDS::DCPS::TransportImpl.

OpenDDS::DCPS::DataLink * OpenDDS::DCPS::SimpleTcpTransport::find_or_create_datalink ( const TransportInterfaceInfo remote_info,
int  connect_as_publisher 
) [protected, virtual]

Either find a suitable DataLink that already exists (and is connected), or create one, connect it, save it off for reuse, and return it.

Implements OpenDDS::DCPS::TransportImpl.

int OpenDDS::DCPS::SimpleTcpTransport::fresh_link ( const ACE_INET_Addr &  remote_address,
SimpleTcpConnection_rch  connection 
)

This function is called by the SimpleTcpReconnectTask thread to check if the passively accepted connection is the re-established connection. If it is, then the "old" connection object in the datalink is replaced by the "new" connection object.

OpenDDS::DCPS::SimpleTcpConfiguration * OpenDDS::DCPS::SimpleTcpTransport::get_configuration (  ) 

int OpenDDS::DCPS::SimpleTcpTransport::make_active_connection ( const ACE_INET_Addr &  remote_address,
SimpleTcpDataLink link 
) [private]

Called by find_or_create_datalink().

int OpenDDS::DCPS::SimpleTcpTransport::make_passive_connection ( const ACE_INET_Addr &  remote_address,
SimpleTcpDataLink link 
) [private]

Called by find_or_create_datalink().

void OpenDDS::DCPS::SimpleTcpTransport::passive_connection ( const ACE_INET_Addr &  remote_address,
SimpleTcpConnection connection 
) [private]

Called by the SimpleTcpConnection object when it has been created by the acceptor and needs to be attached to a DataLink. The DataLink may or may not already be created and waiting for this passive connection to appear. Note that the SimpleTcpConnection* "ownership" is given away to the passive_connection() call.

void OpenDDS::DCPS::SimpleTcpTransport::pre_shutdown_i (  )  [protected, virtual]

Called before transport is shutdown to let the concrete transport to do anything necessary.

Reimplemented from OpenDDS::DCPS::TransportImpl.

void OpenDDS::DCPS::SimpleTcpTransport::release_datalink_i ( DataLink link  )  [protected, virtual]

Called by the DataLink to release itself.

Implements OpenDDS::DCPS::TransportImpl.

void OpenDDS::DCPS::SimpleTcpTransport::shutdown_i (  )  [protected, virtual]

Called during the shutdown() method in order to give the concrete TransportImpl subclass a chance to do something when the shutdown "event" occurs.

Implements OpenDDS::DCPS::TransportImpl.


Friends And Related Function Documentation

friend class SimpleTcpConnection [friend]

The SimpleTcpConnection is our friend. It tells us when it has been created (by our acceptor_), and is seeking the DataLink that should be (or will be) expecting the passive connection.

friend class SimpleTcpDataLink [friend]


Member Data Documentation

SimpleTcpAcceptor* OpenDDS::DCPS::SimpleTcpTransport::acceptor_ [private]

Used to accept passive connections on our local_address_.

SimpleTcpConnectionReplaceTask* OpenDDS::DCPS::SimpleTcpTransport::con_checker_ [private]

This task is used to resolve some deadlock situation duing reconnecting. TODO: reuse the reconnect_task in the SimpleTcpConnection for new connection checking.

AddrConnectionMap OpenDDS::DCPS::SimpleTcpTransport::connections_ [private]

Map of passive connection objects that need to be paired with a DataLink.

LockType OpenDDS::DCPS::SimpleTcpTransport::connections_lock_ [private]

This protects the connections_ and the connections_updated_ data members.

ConditionType OpenDDS::DCPS::SimpleTcpTransport::connections_updated_ [private]

Condition that will be signal()'ed whenever something has been inserted into connections_.

AddrLinkMap OpenDDS::DCPS::SimpleTcpTransport::links_ [private]

This is the map of connected DataLinks.

LockType OpenDDS::DCPS::SimpleTcpTransport::links_lock_ [private]

This lock is used to protect the links_ data member.

TransportReactorTask_rch OpenDDS::DCPS::SimpleTcpTransport::reactor_task_ [private]

We need the reactor for our Acceptor.

Reimplemented from OpenDDS::DCPS::TransportImpl.

SimpleTcpConfiguration_rch OpenDDS::DCPS::SimpleTcpTransport::tcp_config_ [private]

Our configuration object, supplied to us in config_i().


The documentation for this class was generated from the following files:
Generated on Fri Nov 7 09:37:50 2008 for OpenDDS by  doxygen 1.4.7