#include <UIPMC_Connector.h>
Inheritance diagram for TAO_UIPMC_Connector:
Concrete instance of the TAO_Connector class. Responsible for establishing a connection with a server and is called from the Connector_Registory.
Definition at line 44 of file UIPMC_Connector.h.
|
Definition at line 92 of file UIPMC_Connector.h. Referenced by close(). |
|
Constructor.
Definition at line 20 of file UIPMC_Connector.cpp.
00021 : TAO_Connector (IOP::TAG_UIPMC) 00022 { 00023 } |
|
Destructor.
Definition at line 25 of file UIPMC_Connector.cpp.
00026 { 00027 } |
|
Cancel the passed cvs handler from the connector.
Implements TAO_Connector. Definition at line 207 of file UIPMC_Connector.cpp.
00209 { 00210 // Noop 00211 return 0; 00212 } |
|
Implements TAO_Connector. Definition at line 178 of file UIPMC_Connector.cpp. References ACE_OS::strchr(), and ACE_OS::strncasecmp().
00179 { 00180 // Check for a valid string 00181 if (!endpoint || !*endpoint) 00182 return -1; // Failure 00183 00184 static const char protocol[] = "miop"; 00185 static size_t const len = sizeof (protocol) - 1; 00186 00187 size_t const slot = ACE_OS::strchr (endpoint, ':') - endpoint; 00188 00189 // Check for the proper prefix in the IOR. If the proper prefix 00190 // isn't in the IOR then it is not an IOR we can use. 00191 if (slot == len 00192 && ACE_OS::strncasecmp (endpoint, protocol, len) == 0) 00193 return 0; 00194 00195 return -1; 00196 // Failure: not a MIOP IOR 00197 // DO NOT throw an exception here. 00198 } |
|
Implements TAO_Connector. Definition at line 44 of file UIPMC_Connector.cpp. References ACE_Hash_Map_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::done(), svc_handler_table_, and SvcHandlerIterator.
00045 { 00046 SvcHandlerIterator iter (svc_handler_table_); 00047 00048 while (!iter.done ()) 00049 { 00050 (*iter).int_id_->remove_reference (); 00051 iter++; 00052 } 00053 00054 return 0; 00055 } |
|
Implements TAO_Connector. Definition at line 139 of file UIPMC_Connector.cpp. References TAO_Profile::_decr_refcnt(), ACE_NEW_RETURN, and TAO_Profile::decode().
00140 { 00141 TAO_Profile *pfile; 00142 ACE_NEW_RETURN (pfile, 00143 TAO_UIPMC_Profile (this->orb_core ()), 00144 0); 00145 00146 int r = pfile->decode (cdr); 00147 if (r == -1) 00148 { 00149 pfile->_decr_refcnt (); 00150 pfile = 0; 00151 } 00152 00153 return pfile; 00154 } |
|
Implements TAO_Connector. Definition at line 93 of file UIPMC_Connector.cpp. References ACE_DEBUG, ACE_NEW_RETURN, ACE_TEXT(), ACE_Event_Handler::add_reference(), TAO_UIPMC_Connection_Handler::addr(), ACE_Hash_Map_Manager_Ex< ACE_INET_Addr, TAO_UIPMC_Connection_Handler *, ACE_Hash< ACE_INET_Addr >, ACE_Equal_To< ACE_INET_Addr >, ACE_Null_Mutex >::bind(), TAO_Transport_Descriptor_Interface::endpoint(), ACE_Hash_Map_Manager_Ex< ACE_INET_Addr, TAO_UIPMC_Connection_Handler *, ACE_Hash< ACE_INET_Addr >, ACE_Equal_To< ACE_INET_Addr >, ACE_Null_Mutex >::find(), TAO_UIPMC_Connection_Handler::get_handle(), LM_DEBUG, TAO_UIPMC_Connection_Handler::local_addr(), TAO_UIPMC_Endpoint::object_addr(), TAO_UIPMC_Connection_Handler::open(), svc_handler_table_, TAO_debug_level, and TAO_Connection_Handler::transport().
00096 { 00097 TAO_UIPMC_Endpoint *uipmc_endpoint = 00098 dynamic_cast<TAO_UIPMC_Endpoint *> (desc.endpoint ()); 00099 00100 if (uipmc_endpoint == 0) 00101 return 0; 00102 00103 const ACE_INET_Addr &remote_address = 00104 uipmc_endpoint->object_addr (); 00105 00106 TAO_UIPMC_Connection_Handler *svc_handler = 0; 00107 00108 if (this->svc_handler_table_.find (remote_address, svc_handler) == -1) 00109 { 00110 TAO_UIPMC_Connection_Handler *svc_handler_i = 0; 00111 ACE_NEW_RETURN (svc_handler_i, 00112 TAO_UIPMC_Connection_Handler (this->orb_core ()), 00113 0); 00114 00115 svc_handler_i->local_addr (ACE_sap_any_cast (ACE_INET_Addr &)); 00116 svc_handler_i->addr (remote_address); 00117 00118 svc_handler_i->open (0); 00119 00120 svc_handler_table_.bind (remote_address, 00121 svc_handler_i); 00122 svc_handler = svc_handler_i; 00123 00124 if (TAO_debug_level > 2) 00125 ACE_DEBUG ((LM_DEBUG, 00126 ACE_TEXT ("(%P|%t) UIPMC_Connector::make_connection, ") 00127 ACE_TEXT ("new connection on HANDLE %d\n"), 00128 svc_handler->get_handle ())); 00129 } 00130 00131 // @@ Michael: We do not use traditional connection management. 00132 svc_handler->add_reference (); 00133 00134 return svc_handler->transport (); 00135 } |
|
Implements TAO_Connector. Definition at line 157 of file UIPMC_Connector.cpp. References ACE_CHECK_RETURN, and ACE_NEW_THROW_EX.
00158 { 00159 // The endpoint should be of the form: 00160 // N.n@host:port/object_key 00161 // or: 00162 // host:port/object_key 00163 00164 TAO_Profile *profile = 0; 00165 ACE_NEW_THROW_EX (profile, 00166 TAO_UIPMC_Profile (this->orb_core ()), 00167 CORBA::NO_MEMORY ( 00168 CORBA::SystemException::_tao_minor_code ( 00169 TAO::VMCID, 00170 ENOMEM), 00171 CORBA::COMPLETED_NO)); 00172 ACE_CHECK_RETURN (0); 00173 00174 return profile; 00175 } |
|
Implements TAO_Connector. Definition at line 201 of file UIPMC_Connector.cpp.
00202 { 00203 return TAO_UIPMC_Profile::object_key_delimiter_; 00204 } |
|
Implements TAO_Connector. Definition at line 30 of file UIPMC_Connector.cpp. References TAO_Connector::create_connect_strategy(), and TAO_Connector::orb_core().
00031 { 00032 this->orb_core (orb_core); 00033 00034 // For the sake of uniformity do 00035 if (this->create_connect_strategy () == -1) 00036 return -1; 00037 00038 // @@ Michael: We do not use traditional connection management. 00039 00040 return 0; 00041 } |
|
= More TAO_Connector methods, please check the documentation on Transport_Connector.h Implements TAO_Connector. Definition at line 58 of file UIPMC_Connector.cpp. References ACE_DEBUG, ACE_TEXT(), ACE_Addr::get_type(), LM_DEBUG, TAO_UIPMC_Endpoint::object_addr(), TAO_Endpoint::tag(), and TAO_debug_level.
00059 { 00060 if (endpoint->tag () != IOP::TAG_UIPMC) 00061 return -1; 00062 00063 TAO_UIPMC_Endpoint *uipmc_endpoint = 00064 dynamic_cast<TAO_UIPMC_Endpoint *> (endpoint ); 00065 00066 if (uipmc_endpoint == 0) 00067 return -1; 00068 00069 const ACE_INET_Addr &remote_address = 00070 uipmc_endpoint->object_addr (); 00071 00072 // Verify that the remote ACE_INET_Addr was initialized properly. 00073 // Failure can occur if hostname lookup failed when initializing the 00074 // remote ACE_INET_Addr. 00075 if (remote_address.get_type () != AF_INET) 00076 { 00077 if (TAO_debug_level > 0) 00078 { 00079 ACE_DEBUG ((LM_DEBUG, 00080 ACE_TEXT ("TAO (%P|%t) UIPMC connection failed.\n") 00081 ACE_TEXT ("TAO (%P|%t) This is most likely ") 00082 ACE_TEXT ("due to a hostname lookup ") 00083 ACE_TEXT ("failure.\n"))); 00084 } 00085 00086 return -1; 00087 } 00088 00089 return 0; 00090 } |
|
Definition at line 85 of file UIPMC_Connector.h. Referenced by close(), and make_connection(). |