#include <SimpleTcpTransport.h>
Inheritance diagram for OpenDDS::DCPS::SimpleTcpTransport:


Public Member Functions | |
| SimpleTcpTransport () | |
| virtual | ~SimpleTcpTransport () |
| SimpleTcpConfiguration * | get_configuration () |
| int | fresh_link (const ACE_INET_Addr &remote_addr, SimpleTcpConnection_rch connection) |
Protected Member Functions | |
| virtual DataLink * | find_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< LockType > | GuardType |
| typedef ACE_Condition< LockType > | ConditionType |
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 | |
| SimpleTcpAcceptor * | acceptor_ |
| 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. | |
| SimpleTcpConnectionReplaceTask * | con_checker_ |
Friends | |
| class | SimpleTcpConnection |
| class | SimpleTcpDataLink |
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.
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.
| OpenDDS::DCPS::SimpleTcpTransport::SimpleTcpTransport | ( | ) |
| OpenDDS::DCPS::SimpleTcpTransport::~SimpleTcpTransport | ( | ) | [virtual] |
| 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] |
| 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.
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] |
Used to accept passive connections on our local_address_.
This task is used to resolve some deadlock situation duing reconnecting. TODO: reuse the reconnect_task in the SimpleTcpConnection for new connection checking.
Map of passive connection objects that need to be paired with a DataLink.
This protects the connections_ and the connections_updated_ data members.
Condition that will be signal()'ed whenever something has been inserted into connections_.
This is the map of connected DataLinks.
This lock is used to protect the links_ data member.
Our configuration object, supplied to us in config_i().
1.4.7