Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

TAO_IIOP_Acceptor Class Reference

TAO_IIOP_Acceptor. More...

#include <IIOP_Acceptor.h>

Inheritance diagram for TAO_IIOP_Acceptor:

Inheritance graph
[legend]
Collaboration diagram for TAO_IIOP_Acceptor:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ACE_Strategy_Acceptor<
TAO_IIOP_Connection_Handler,
ACE_SOCK_ACCEPTOR
TAO_IIOP_BASE_ACCEPTOR
typedef TAO_Creation_Strategy<
TAO_IIOP_Connection_Handler
TAO_IIOP_CREATION_STRATEGY
typedef TAO_Concurrency_Strategy<
TAO_IIOP_Connection_Handler
TAO_IIOP_CONCURRENCY_STRATEGY
typedef TAO_Accept_Strategy<
TAO_IIOP_Connection_Handler,
ACE_SOCK_ACCEPTOR
TAO_IIOP_ACCEPT_STRATEGY

Public Methods

 TAO_IIOP_Acceptor (CORBA::Boolean flag=0)
 Constructor. More...

 ~TAO_IIOP_Acceptor (void)
 Destructor. More...

const ACE_INET_Addraddress (void) const
 Helper method for the implementation repository, should go away. More...

const ACE_INET_Addrendpoints (void)
 Returns the array of endpoints in this acceptor. More...

virtual int open (TAO_ORB_Core *orb_core, ACE_Reactor *reactor, int version_major, int version_minor, const char *address, const char *options=0)
virtual int open_default (TAO_ORB_Core *orb_core, ACE_Reactor *reactor, int version_major, int version_minor, const char *options=0)
virtual int close (void)
 Closes the acceptor. More...

virtual int create_profile (const TAO_ObjectKey &object_key, TAO_MProfile &mprofile, CORBA::Short priority)
virtual int is_collocated (const TAO_Endpoint *endpoint)
 Return 1 if the <endpoint> has the same address as the acceptor. More...

virtual CORBA::ULong endpoint_count (void)
virtual int object_key (IOP::TaggedProfile &profile, TAO_ObjectKey &key)
int hostname (TAO_ORB_Core *orb_core, ACE_INET_Addr &addr, char *&host, const char *specified_hostname=0)
int dotted_decimal_address (ACE_INET_Addr &addr, char *&host)

Protected Methods

virtual int open_i (const ACE_INET_Addr &addr, ACE_Reactor *reactor)
int probe_interfaces (TAO_ORB_Core *orb_core)
virtual int parse_options (const char *options)
int init_tcp_properties (void)
 Obtain tcp properties that must be used by this acceptor, i.e., initialize <tcp_properties_>. More...

int create_new_profile (const TAO_ObjectKey &object_key, TAO_MProfile &mprofile, CORBA::Short priority)
 Helper method to add a new profile to the mprofile for each endpoint. More...

int create_shared_profile (const TAO_ObjectKey &object_key, TAO_MProfile &mprofile, CORBA::Short priority)
 Helper method to create a profile that contains all of our endpoints. More...


Protected Attributes

ACE_INET_Addraddrs_
 Array of ACE_INET_Addr instances, each one corresponding to a given network interface. More...

u_short port_span_
char ** hosts_
CORBA::ULong endpoint_count_
 The number of host names cached in the hosts_ array (equivalent to the number of endpoints opened by this Acceptor). More...

char * hostname_in_ior_
TAO_GIOP_Message_Version version_
TAO_ORB_Coreorb_core_
 ORB Core. More...

TAO_IIOP_Properties tcp_properties_
 TCP configuration properties to be used for all connections opened by this acceptor. More...

CORBA::Boolean lite_flag_
 Should we use GIOP lite?? More...


Private Attributes

TAO_IIOP_BASE_ACCEPTOR base_acceptor_
 the concrete acceptor, as a pointer to it's base class. More...

TAO_IIOP_CREATION_STRATEGYcreation_strategy_
 Acceptor strategies. More...

TAO_IIOP_CONCURRENCY_STRATEGYconcurrency_strategy_
TAO_IIOP_ACCEPT_STRATEGYaccept_strategy_

Detailed Description

TAO_IIOP_Acceptor.

The IIOP-specific bridge class for the concrete acceptor.

Definition at line 44 of file IIOP_Acceptor.h.


Member Typedef Documentation

typedef TAO_Accept_Strategy<TAO_IIOP_Connection_Handler, ACE_SOCK_ACCEPTOR> TAO_IIOP_Acceptor::TAO_IIOP_ACCEPT_STRATEGY
 

Definition at line 63 of file IIOP_Acceptor.h.

typedef ACE_Strategy_Acceptor<TAO_IIOP_Connection_Handler, ACE_SOCK_ACCEPTOR> TAO_IIOP_Acceptor::TAO_IIOP_BASE_ACCEPTOR
 

Definition at line 60 of file IIOP_Acceptor.h.

typedef TAO_Concurrency_Strategy<TAO_IIOP_Connection_Handler> TAO_IIOP_Acceptor::TAO_IIOP_CONCURRENCY_STRATEGY
 

Definition at line 62 of file IIOP_Acceptor.h.

typedef TAO_Creation_Strategy<TAO_IIOP_Connection_Handler> TAO_IIOP_Acceptor::TAO_IIOP_CREATION_STRATEGY
 

Definition at line 61 of file IIOP_Acceptor.h.


Constructor & Destructor Documentation

TAO_IIOP_Acceptor::TAO_IIOP_Acceptor CORBA::Boolean    flag = 0
 

Constructor.

Definition at line 53 of file IIOP_Acceptor.cpp.

References IOP::TAG_INTERNET_IOP, TAO_DEF_GIOP_MAJOR, and TAO_DEF_GIOP_MINOR.

00054   : TAO_Acceptor (IOP::TAG_INTERNET_IOP),
00055     addrs_ (0),
00056     port_span_ (1),
00057     hosts_ (0),
00058     endpoint_count_ (0),
00059     hostname_in_ior_ (0),
00060     version_ (TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR),
00061     orb_core_ (0),
00062     lite_flag_ (flag),
00063     base_acceptor_ (),
00064     creation_strategy_ (0),
00065     concurrency_strategy_ (0),
00066     accept_strategy_ (0)
00067 {
00068 }

TAO_IIOP_Acceptor::~TAO_IIOP_Acceptor void   
 

Destructor.

Definition at line 70 of file IIOP_Acceptor.cpp.

References accept_strategy_, addrs_, close, concurrency_strategy_, creation_strategy_, endpoint_count_, hosts_, and CORBA::string_free.

00071 {
00072   // Make sure we are closed before we start destroying the
00073   // strategies.
00074   this->close ();
00075 
00076   delete this->creation_strategy_;
00077   delete this->concurrency_strategy_;
00078   delete this->accept_strategy_;
00079 
00080   delete [] this->addrs_;
00081 
00082   for (CORBA::ULong i = 0; i < this->endpoint_count_; ++i)
00083     CORBA::string_free (this->hosts_[i]);
00084 
00085   delete [] this->hosts_;
00086 }


Member Function Documentation

ACE_INLINE const ACE_INET_Addr & TAO_IIOP_Acceptor::address void    const
 

Helper method for the implementation repository, should go away.

@

Definition at line 5 of file IIOP_Acceptor.i.

References ACE_ASSERT, and addrs_.

Referenced by open, and open_i.

00006 {
00007   ACE_ASSERT (this->addrs_ != 0);
00008 
00009   // @@ This is busted.
00010   //    The Implementation Repository will have to start supporting
00011   //    IORs with multiple profiles.  For now, we just return the
00012   //    first addr.
00013   //                    -Ossama
00014   return this->addrs_[0];
00015 }

int TAO_IIOP_Acceptor::close void    [virtual]
 

Closes the acceptor.

Implements TAO_Acceptor.

Definition at line 260 of file IIOP_Acceptor.cpp.

References base_acceptor_.

Referenced by ~TAO_IIOP_Acceptor.

00261 {
00262   return this->base_acceptor_.close ();
00263 }

int TAO_IIOP_Acceptor::create_new_profile const TAO_ObjectKey   object_key,
TAO_MProfile   mprofile,
CORBA::Short    priority
[protected]
 

Helper method to add a new profile to the mprofile for each endpoint.

Definition at line 112 of file IIOP_Acceptor.cpp.

References TAO_Profile::_decr_refcnt, ACE_NEW_RETURN, addrs_, TAO_ORB_Core::codeset_manager, TAO_IIOP_Profile::endpoint, endpoint_count_, TAO_MProfile::give_profile, TAO_MProfile::grow, TAO_GIOP_Message_Version::major, TAO_GIOP_Message_Version::minor, orb_core_, TAO_ORB_Core::orb_params, TAO_Endpoint::priority, TAO_MProfile::profile_count, TAO_Tagged_Components::set_orb_type, TAO_MProfile::size, TAO_ORB_Parameters::std_profile_components, TAO_Profile::tagged_components, TAO_ORB_TYPE, and version_.

Referenced by create_profile.

00115 {
00116   // Adding this->endpoint_count_ to the TAO_MProfile.
00117   int count = mprofile.profile_count ();
00118   if ((mprofile.size () - count) < this->endpoint_count_
00119       && mprofile.grow (count + this->endpoint_count_) == -1)
00120     return -1;
00121 
00122   // Create a profile for each acceptor endpoint.
00123   for (CORBA::ULong i = 0; i < this->endpoint_count_; ++i)
00124     {
00125       TAO_IIOP_Profile *pfile = 0;
00126       ACE_NEW_RETURN (pfile,
00127                       TAO_IIOP_Profile (this->hosts_[i],
00128                                         this->addrs_[i].get_port_number (),
00129                                         object_key,
00130                                         this->addrs_[i],
00131                                         this->version_,
00132                                         this->orb_core_),
00133                       -1);
00134       pfile->endpoint ()->priority (priority);
00135 
00136       if (mprofile.give_profile (pfile) == -1)
00137         {
00138           pfile->_decr_refcnt ();
00139           pfile = 0;
00140           return -1;
00141         }
00142 
00143       // Do not add any tagged components to the profile if configured
00144       // by the user not to do so, or if an IIOP 1.0 endpoint is being
00145       // created (IIOP 1.0 did not support tagged components).
00146       if (this->orb_core_->orb_params ()->std_profile_components () == 0
00147           || (this->version_.major == 1 && this->version_.minor == 0))
00148         continue;
00149 
00150       pfile->tagged_components ().set_orb_type (TAO_ORB_TYPE);
00151 
00152       this->orb_core_->codeset_manager()->
00153         set_codeset(pfile->tagged_components());
00154     }
00155 
00156   return 0;
00157 }

int TAO_IIOP_Acceptor::create_profile const TAO_ObjectKey   object_key,
TAO_MProfile   mprofile,
CORBA::Short    priority
[virtual]
 

Create the corresponding profile for this endpoint. If share_profile is set to true, the pluggable protocol implementation should try to add the endpoint to a profile in the mprofile that is of the same type. Currently, this is used when RT CORBA is enabled.

Implements TAO_Acceptor.

Definition at line 91 of file IIOP_Acceptor.cpp.

References create_new_profile, create_shared_profile, endpoint_count_, and TAO_INVALID_PRIORITY.

00094 {
00095   // Sanity check.
00096   if (this->endpoint_count_ == 0)
00097     return -1;
00098 
00099   // Check if multiple endpoints should be put in one profile or
00100   // if they should be spread across multiple profiles.
00101   if (priority == TAO_INVALID_PRIORITY)
00102     return this->create_new_profile (object_key,
00103                                      mprofile,
00104                                      priority);
00105   else
00106     return this->create_shared_profile (object_key,
00107                                         mprofile,
00108                                         priority);
00109 }

int TAO_IIOP_Acceptor::create_shared_profile const TAO_ObjectKey   object_key,
TAO_MProfile   mprofile,
CORBA::Short    priority
[protected]
 

Helper method to create a profile that contains all of our endpoints.

Definition at line 160 of file IIOP_Acceptor.cpp.

References TAO_Profile::_decr_refcnt, ACE_NEW_RETURN, TAO_IIOP_Profile::add_endpoint, addrs_, TAO_ORB_Core::codeset_manager, TAO_IIOP_Profile::endpoint, endpoint_count_, TAO_MProfile::get_profile, TAO_MProfile::give_profile, TAO_GIOP_Message_Version::major, TAO_GIOP_Message_Version::minor, orb_core_, TAO_ORB_Core::orb_params, TAO_Endpoint::priority, TAO_MProfile::profile_count, TAO_Tagged_Components::set_orb_type, TAO_ORB_Parameters::std_profile_components, TAO_Profile::tag, TAO_Profile::tagged_components, TAO_ORB_TYPE, TAO_PHandle, and version_.

Referenced by create_profile.

00163 {
00164   CORBA::ULong index = 0;
00165   TAO_Profile *pfile = 0;
00166   TAO_IIOP_Profile *iiop_profile = 0;
00167 
00168   // First see if <mprofile> already contains a IIOP profile.
00169   for (TAO_PHandle i = 0; i != mprofile.profile_count (); ++i)
00170     {
00171       pfile = mprofile.get_profile (i);
00172       if (pfile->tag () == IOP::TAG_INTERNET_IOP)
00173         {
00174           iiop_profile = ACE_dynamic_cast (TAO_IIOP_Profile *,
00175                                            pfile);
00176           break;
00177         }
00178     }
00179 
00180   // If <mprofile> doesn't contain a IIOP_Profile, we need to create
00181   // one.
00182   if (iiop_profile == 0)
00183     {
00184       ACE_NEW_RETURN (iiop_profile,
00185                       TAO_IIOP_Profile (this->hosts_[0],
00186                                         this->addrs_[0].get_port_number (),
00187                                         object_key,
00188                                         this->addrs_[0],
00189                                         this->version_,
00190                                         this->orb_core_),
00191                       -1);
00192       iiop_profile->endpoint ()->priority (priority);
00193 
00194       if (mprofile.give_profile (iiop_profile) == -1)
00195         {
00196           iiop_profile->_decr_refcnt ();
00197           iiop_profile = 0;
00198           return -1;
00199         }
00200 
00201       // Do not add any tagged components to the profile if configured
00202       // by the user not to do so, or if an IIOP 1.0 endpoint is being
00203       // created (IIOP 1.0 did not support tagged components).
00204       if (this->orb_core_->orb_params ()->std_profile_components () != 0
00205           && (this->version_.major >= 1 && this->version_.minor >= 1))
00206         {
00207           iiop_profile->tagged_components ().set_orb_type (TAO_ORB_TYPE);
00208           this->orb_core_->codeset_manager()->
00209             set_codeset(iiop_profile->tagged_components());
00210         }
00211 
00212       index = 1;
00213     }
00214 
00215   // Add any remaining acceptor endpoints to the IIOP_Profile.
00216   for (;
00217        index < this->endpoint_count_;
00218        ++index)
00219     {
00220       TAO_IIOP_Endpoint *endpoint = 0;
00221       ACE_NEW_RETURN (endpoint,
00222                       TAO_IIOP_Endpoint (this->hosts_[index],
00223                                          this->addrs_[index].get_port_number (),
00224                                          this->addrs_[index]),
00225                       -1);
00226       endpoint->priority (priority);
00227       iiop_profile->add_endpoint (endpoint);
00228     }
00229 
00230   return 0;
00231 }

int TAO_IIOP_Acceptor::dotted_decimal_address ACE_INET_Addr   addr,
char *&    host
 

Set the host name for the given address using the dotted decimal format.

Definition at line 609 of file IIOP_Acceptor.cpp.

References ACE_DEBUG, ACE_TEXT, ACE_INET_Addr::get_host_addr, ACE_INET_Addr::get_host_name, ACE_INET_Addr::get_ip_address, ACE_INET_Addr::get_port_number, LM_DEBUG, ACE_INET_Addr::set, and CORBA::string_dup.

Referenced by hostname.

00611 {
00612   int result = 0;
00613   const char *tmp = 0;
00614 
00615   // If the IP address in the INET_Addr is the INADDR_ANY address,
00616   // then force the actual IP address to be used by initializing a new
00617   // INET_Addr with the hostname from the original one.  If that fails
00618   // then something is seriously wrong with the systems networking
00619   // setup.
00620   if (addr.get_ip_address () == INADDR_ANY)
00621     {
00622       ACE_INET_Addr new_addr;
00623       result = new_addr.set (addr.get_port_number (),
00624                              addr.get_host_name ());
00625       tmp = new_addr.get_host_addr ();
00626     }
00627   else
00628     tmp = addr.get_host_addr ();
00629 
00630   if (tmp == 0 || result != 0)
00631     {
00632       if (TAO_debug_level > 0)
00633         ACE_DEBUG ((LM_DEBUG,
00634                     ACE_TEXT ("\n\nTAO (%P|%t) ")
00635                     ACE_TEXT ("IIOP_Acceptor::dotted_decimal_address ")
00636                     ACE_TEXT ("- %p\n\n"),
00637                     ACE_TEXT ("cannot determine hostname")));
00638       return -1;
00639     }
00640 
00641   host = CORBA::string_dup (tmp);
00642   return 0;
00643 }

CORBA::ULong TAO_IIOP_Acceptor::endpoint_count void    [virtual]
 

Returns the number of endpoints this acceptor is listening on. This is used for determining how many profiles will be generated for this acceptor.

Implements TAO_Acceptor.

Definition at line 757 of file IIOP_Acceptor.cpp.

References endpoint_count_.

Referenced by TAO_IIOP_Transport::get_listen_point.

00758 {
00759   return this->endpoint_count_;
00760 }

ACE_INLINE const ACE_INET_Addr * TAO_IIOP_Acceptor::endpoints void   
 

Returns the array of endpoints in this acceptor.

Definition at line 18 of file IIOP_Acceptor.i.

References ACE_ASSERT, and addrs_.

Referenced by TAO_IIOP_Transport::get_listen_point.

00019 {
00020   ACE_ASSERT (this->addrs_ != 0);
00021 
00022   return this->addrs_;
00023 }

int TAO_IIOP_Acceptor::hostname TAO_ORB_Core   orb_core,
ACE_INET_Addr   addr,
char *&    host,
const char *    specified_hostname = 0
 

Set the host name for the given addr. A hostname may be forced by using specified_hostname. This is useful if the given address corresponds to more than one hostname and the desired one cannot be determined in any other way.

Definition at line 572 of file IIOP_Acceptor.cpp.

References dotted_decimal_address, ACE_INET_Addr::get_host_name, MAXHOSTNAMELEN, TAO_ORB_Core::orb_params, CORBA::string_dup, and TAO_ORB_Parameters::use_dotted_decimal_addresses.

Referenced by TAO_IIOP_Transport::get_listen_point, open, and probe_interfaces.

00576 {
00577   if (orb_core->orb_params ()->use_dotted_decimal_addresses ())
00578     {
00579       // If dotted decimal addresses are enabled,
00580       // just return ours.
00581       return this->dotted_decimal_address (addr, host);
00582     }
00583   else if (specified_hostname != 0)
00584     {
00585       // If the user specified a hostname, pass it back
00586       // blindly as it overrides our choice of hostname.
00587       host = CORBA::string_dup (specified_hostname);
00588     }
00589   else
00590     {
00591       char tmp_host[MAXHOSTNAMELEN + 1];
00592 
00593       // Get the hostname associated with our address
00594       if (addr.get_host_name (tmp_host, sizeof (tmp_host)) != 0)
00595         {
00596           // On failure, just return the decimal address.
00597           return this->dotted_decimal_address (addr, host);
00598         }
00599       else
00600         {
00601           host = CORBA::string_dup (tmp_host);
00602         }
00603     }
00604 
00605   return 0;
00606 }

int TAO_IIOP_Acceptor::init_tcp_properties void    [protected]
 

Obtain tcp properties that must be used by this acceptor, i.e., initialize <tcp_properties_>.

Definition at line 929 of file IIOP_Acceptor.cpp.

References ACE_CHECK_RETURN, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENV_SINGLE_ARG_PARAMETER, TAO_Protocols_Hooks::call_server_protocols_hook, TAO_IIOP_Properties::enable_network_priority, TAO_ORB_Core::get_protocols_hooks, TAO_IIOP_Properties::no_delay, TAO_ORB_Parameters::nodelay, orb_core_, TAO_ORB_Core::orb_params, TAO_IIOP_Properties::recv_buffer_size, TAO_IIOP_Properties::send_buffer_size, TAO_ORB_Parameters::sock_rcvbuf_size, TAO_ORB_Parameters::sock_sndbuf_size, and tcp_properties_.

Referenced by open, and open_default.

00930 {
00931   // @@ Currently (in the code below), we obtain protocol properties from
00932   // ORB-level ServerProtocol, even though the policy may
00933   // have been overridden on POA level.  That's because currently all
00934   // endpoints (acceptors) are global.  Once endpoints become per POA,
00935   // the code below will have to be changed to look at the POA-level
00936   // ServerProtocol policy first.
00937 
00938   // @@ Later we may want to factor some of the code below
00939   // among different protocols and place it into TAO_Acceptor, for
00940   // example.
00941 
00942   // ServerProtocolProperties policy controls protocols configuration.
00943   // Look for protocol properties in the effective ServerProtocolPolicy.
00944 
00945   ACE_DECLARE_NEW_CORBA_ENV;
00946 
00947   // Initialize the parameters to their defaults.  If RTCORBA is loaded,
00948   // the server_protocols_hook will override any of the values if they
00949   // have been set by a ServerProtocolProperties policy.
00950 
00951   int send_buffer_size = this->orb_core_->orb_params ()->sock_sndbuf_size ();
00952   int recv_buffer_size = this->orb_core_->orb_params ()->sock_rcvbuf_size ();
00953   int no_delay = this->orb_core_->orb_params ()->nodelay ();
00954   int enable_network_priority = 0;
00955 
00956   TAO_Protocols_Hooks *tph = this->orb_core_->get_protocols_hooks (ACE_ENV_SINGLE_ARG_PARAMETER);
00957   ACE_CHECK_RETURN (-1);
00958 
00959   if (tph != 0)
00960     {
00961       const char protocol [] = "iiop";
00962       const char *protocol_type = protocol;
00963 
00964       int hook_return =
00965         tph->call_server_protocols_hook (send_buffer_size,
00966                                          recv_buffer_size,
00967                                          no_delay,
00968                                          enable_network_priority,
00969                                          protocol_type);
00970 
00971       if (hook_return == -1)
00972         return -1;
00973     }
00974 
00975   this->tcp_properties_.send_buffer_size =
00976     send_buffer_size;
00977   this->tcp_properties_.recv_buffer_size =
00978     recv_buffer_size;
00979   this->tcp_properties_.no_delay =
00980     no_delay;
00981  this->tcp_properties_.enable_network_priority  =
00982    enable_network_priority;
00983 
00984 
00985   // @@ NOTE.  RTCORBA treats a combination of transport+messaging
00986   // as a single protocol.  Keep this in mind for when we adopt
00987   // RTCORBA approach to protocols configuration for nonRT use.  In
00988   // particular, what are the semantics of independent variation of
00989   // messaging and transport layers, when one transport appears in
00990   // combination with several messaging protocols, for example.
00991 
00992   return 0;
00993 }

int TAO_IIOP_Acceptor::is_collocated const TAO_Endpoint   endpoint [virtual]
 

Return 1 if the <endpoint> has the same address as the acceptor.

Implements TAO_Acceptor.

Definition at line 234 of file IIOP_Acceptor.cpp.

References addrs_, endpoint_count_, ACE_INET_Addr::get_port_number, TAO_IIOP_Endpoint::host, hosts_, TAO_IIOP_Endpoint::port, and ACE_OS_String::strcmp.

00235 {
00236   const TAO_IIOP_Endpoint *endp =
00237     ACE_dynamic_cast (const TAO_IIOP_Endpoint *, endpoint);
00238 
00239   // Make sure the dynamically cast pointer is valid.
00240   if (endp == 0)
00241     return 0;
00242 
00243   for (CORBA::ULong i = 0; i < this->endpoint_count_; ++i)
00244     {
00245       // compare the port and host name.  Please do *NOT* optimize
00246       // this code by comparing the IP address instead.  That would
00247       // trigger the following bug:
00248       //
00249       // http://deuce.doc.wustl.edu/bugzilla/show_bug.cgi?id=1220
00250       //
00251       if (endp->port() == this->addrs_[i].get_port_number()
00252           && ACE_OS::strcmp(endp->host(), this->hosts_[i]) == 0)
00253         return 1;
00254     }
00255 
00256   return 0;
00257 }

int TAO_IIOP_Acceptor::object_key IOP::TaggedProfile   profile,
TAO_ObjectKey   key
[virtual]
 

This method fetches the <key> from the <profile>. Protocols that are pluggable can send data that are specific in the <profile_data> field encapsulated as a octet stream. This method allows those protocols to get the object key from the encapsulation.

Implements TAO_Acceptor.

Definition at line 763 of file IIOP_Acceptor.cpp.

References ACE_DEBUG, ACE_LIB_TEXT, ACE_TEXT, LM_DEBUG, IOP::TaggedProfile::profile_data, ACE_InputCDR::read_octet, ACE_InputCDR::read_string, and ACE_InputCDR::read_ushort.

00765 {
00766   // Create the decoding stream from the encapsulation in the buffer,
00767 #if (TAO_NO_COPY_OCTET_SEQUENCES == 1)
00768   TAO_InputCDR cdr (profile.profile_data.mb ());
00769 #else
00770   TAO_InputCDR cdr (ACE_reinterpret_cast(char*,profile.profile_data.get_buffer ()),
00771                     profile.profile_data.length ());
00772 #endif /* TAO_NO_COPY_OCTET_SEQUENCES == 1 */
00773 
00774   CORBA::Octet major, minor;
00775 
00776   // Read the version. We just read it here. We don't*do any*
00777   // processing.
00778   if (!(cdr.read_octet (major)
00779         && cdr.read_octet (minor)))
00780     {
00781       if (TAO_debug_level > 0)
00782         {
00783           ACE_DEBUG ((LM_DEBUG,
00784                       ACE_TEXT ("TAO (%P|%t) IIOP_Profile::decode - v%d.%d\n"),
00785                       major,
00786                       minor));
00787         }
00788       return -1;
00789     }
00790 
00791   CORBA::String_var host;
00792   CORBA::UShort port = 0;
00793 
00794   // Get host and port. No processing here too..
00795   if (cdr.read_string (host.out ()) == 0
00796       || cdr.read_ushort (port) == 0)
00797     {
00798       if (TAO_debug_level > 0)
00799         {
00800           ACE_DEBUG ((LM_DEBUG,
00801                       ACE_LIB_TEXT ("TAO (%P|%t) TAO_IIOP_Acceptor::object_key - ")
00802                       ACE_LIB_TEXT ("error while decoding host/port")));
00803         }
00804       return -1;
00805     }
00806 
00807   // ... and object key.
00808   if ((cdr >> object_key) == 0)
00809     return -1;
00810 
00811   // We are NOT bothered about the rest.
00812 
00813   return 1;
00814 }

int TAO_IIOP_Acceptor::open TAO_ORB_Core   orb_core,
ACE_Reactor   reactor,
int    version_major,
int    version_minor,
const char *    address,
const char *    options = 0
[virtual]
 

The TAO_Acceptor methods, check the documentation in Transport_Acceptor.h for details.

Implements TAO_Acceptor.

Definition at line 266 of file IIOP_Acceptor.cpp.

References ACE_DEBUG, ACE_ERROR_RETURN, ACE_NEW_RETURN, ACE_TEXT, address, addrs_, endpoint_count_, ACE_INET_Addr::get_port_number, hostname, hostname_in_ior_, hosts_, init_tcp_properties, LM_DEBUG, LM_ERROR, MAXHOSTNAMELEN, ACE_OS_String::memcpy, open_i, orb_core_, parse_options, probe_interfaces, ACE_INET_Addr::set, TAO_GIOP_Message_Version::set_version, ACE_OS_String::strchr, and version_.

00272 {
00273   this->orb_core_ = orb_core;
00274 
00275   if (this->init_tcp_properties () != 0)
00276     return -1;
00277 
00278   if (this->hosts_ != 0)
00279     {
00280       // The hostname cache has already been set!
00281       // This is bad mojo, i.e. an internal TAO error.
00282       ACE_ERROR_RETURN ((LM_ERROR,
00283                          ACE_TEXT ("TAO (%P|%t) ")
00284                          ACE_TEXT ("IIOP_Acceptor::open - "),
00285                          ACE_TEXT ("hostname already set\n\n")),
00286                         -1);
00287     }
00288 
00289   if (address == 0)
00290     return -1;
00291 
00292   if (major >=0 && minor >= 0)
00293     this->version_.set_version (ACE_static_cast (CORBA::Octet,
00294                                                  major),
00295                                 ACE_static_cast (CORBA::Octet,
00296                                                  minor));
00297   // Parse options
00298   if (this->parse_options (options) == -1)
00299     return -1;
00300 
00301   ACE_INET_Addr addr;
00302 
00303   const char *port_separator_loc = ACE_OS::strchr (address, ':');
00304   const char *specified_hostname = 0;
00305   char tmp_host[MAXHOSTNAMELEN + 1];
00306 
00307   if (port_separator_loc == address)
00308     {
00309       // The address is a port number or port name.  No hostname was
00310       // specified.  The hostname for each network interface and the
00311       // fully qualified domain name must be obtained.
00312 
00313       // Check for multiple network interfaces.
00314       if (this->probe_interfaces (orb_core) == -1)
00315         return -1;
00316 
00317       // First convert the port into a usable form.
00318       if (addr.set (address + sizeof (':')) != 0)
00319         return -1;
00320 
00321       // Now reset the port and set the host.
00322       if (addr.set (addr.get_port_number (),
00323                     ACE_static_cast (ACE_UINT32, INADDR_ANY),
00324                     1) != 0)
00325         return -1;
00326       else
00327         return this->open_i (addr,
00328                              reactor);
00329     }
00330   else if (port_separator_loc == 0)
00331     {
00332       // The address is a hostname.  No port was specified, so assume
00333       // port zero (port will be chosen for us).
00334       if (addr.set ((unsigned short) 0, address) != 0)
00335         return -1;
00336 
00337       specified_hostname = address;
00338     }
00339   else
00340     {
00341       // Host and port were specified.
00342       if (addr.set (address) != 0)
00343         return -1;
00344 
00345       // Extract out just the host part of the address.
00346       size_t len = port_separator_loc - address;
00347       ACE_OS::memcpy (tmp_host, address, len);
00348       tmp_host[len] = '\0';
00349 
00350       specified_hostname = tmp_host;
00351     }
00352 
00353   this->endpoint_count_ = 1;  // Only one hostname to store
00354 
00355   ACE_NEW_RETURN (this->addrs_,
00356                   ACE_INET_Addr[this->endpoint_count_],
00357                   -1);
00358 
00359   ACE_NEW_RETURN (this->hosts_,
00360                   char *[this->endpoint_count_],
00361                   -1);
00362 
00363   this->hosts_[0] = 0;
00364 
00365   if (this->hostname_in_ior_ != 0)
00366     {
00367       if (TAO_debug_level > 2)
00368         {
00369           ACE_DEBUG ((LM_DEBUG,
00370                       ACE_TEXT ("Overriding address in IOR with %s\n"),
00371                       this->hostname_in_ior_));
00372         }
00373       if (this->hostname (orb_core,
00374                           addr,
00375                           this->hosts_[0],
00376                           this->hostname_in_ior_) != 0)
00377         return -1;
00378     }
00379   else
00380     {
00381       if (this->hostname (orb_core,
00382                           addr,
00383                           this->hosts_[0],
00384                           specified_hostname) != 0)
00385         return -1;
00386     }
00387 
00388   // Copy the addr.  The port is (re)set in
00389   // TAO_IIOP_Acceptor::open_i().
00390   if (this->addrs_[0].set (addr) != 0)
00391     return -1;
00392 
00393   return this->open_i (addr,
00394                        reactor);
00395 }

int TAO_IIOP_Acceptor::open_default TAO_ORB_Core   orb_core,
ACE_Reactor   reactor,
int    version_major,
int    version_minor,
const char *    options = 0
[virtual]
 

Open an acceptor with the given protocol version on a default endpoint

Implements TAO_Acceptor.

Definition at line 398 of file IIOP_Acceptor.cpp.

References ACE_ERROR_RETURN, ACE_TEXT, hosts_, init_tcp_properties, LM_ERROR, open_i, orb_core_, parse_options, probe_interfaces, ACE_INET_Addr::set, TAO_GIOP_Message_Version::set_version, and version_.

00403 {
00404   this->orb_core_ = orb_core;
00405 
00406   if (this->init_tcp_properties () != 0)
00407     return -1;
00408 
00409   if (this->hosts_ != 0)
00410     {
00411       // The hostname cache has already been set!
00412       // This is bad mojo, i.e. an internal TAO error.
00413       ACE_ERROR_RETURN ((LM_ERROR,
00414                          ACE_TEXT ("TAO (%P|%t) ")
00415                          ACE_TEXT ("IIOP_Acceptor::open_default - "),
00416                          ACE_TEXT ("hostname already set\n\n")),
00417                         -1);
00418     }
00419 
00420   if (major >=0 && minor >= 0)
00421     this->version_.set_version (ACE_static_cast (CORBA::Octet,
00422                                                  major),
00423                                 ACE_static_cast (CORBA::Octet,
00424                                                  minor));
00425 
00426   // Parse options
00427   if (this->parse_options (options) == -1)
00428     return -1;
00429 
00430   // Check for multiple network interfaces.
00431   if (this->probe_interfaces (orb_core) == -1)
00432     return -1;
00433 
00434   // Now that each network interface's hostname has been cached, open
00435   // an endpoint on each network interface using the INADDR_ANY
00436   // address.
00437   ACE_INET_Addr addr;
00438 
00439   if (addr.set (ACE_static_cast(u_short, 0),
00440                 ACE_static_cast(ACE_UINT32, INADDR_ANY),
00441                 1) != 0)
00442     return -1;
00443 
00444   return this->open_i (addr,
00445                        reactor);
00446 }

int TAO_IIOP_Acceptor::open_i const ACE_INET_Addr   addr,
ACE_Reactor   reactor
[protected, virtual]
 

Implement the common part of the open*() methods. This method is virtual to allow a derived class implementation to be invoked instead.

Definition at line 449 of file IIOP_Acceptor.cpp.

References ACE_Strategy_Acceptor< TAO_IIOP_Connection_Handler, ACE_SOCK_ACCEPTOR >::acceptor, ACE_CLOEXEC, ACE_DEBUG, ACE_LIB_TEXT, ACE_MAX_DEFAULT_PORT, ACE_NEW_RETURN, ACE_TEXT, ACE_TEXT_CHAR_TO_TCHAR, address, addrs_, base_acceptor_, endpoint_count_, ACE_INET_Addr::get_port_number, LM_DEBUG, ACE_Strategy_Acceptor< TAO_IIOP_Connection_Handler, ACE_SOCK_ACCEPTOR >::open, port_span_, and ACE_INET_Addr::set_port_number.

Referenced by open, and open_default.

00451 {
00452   ACE_NEW_RETURN (this->creation_strategy_,
00453                   TAO_IIOP_CREATION_STRATEGY (this->orb_core_,
00454                                               &(this->tcp_properties_),
00455                                               this->lite_flag_),
00456                   -1);
00457 
00458   ACE_NEW_RETURN (this->concurrency_strategy_,
00459                   TAO_IIOP_CONCURRENCY_STRATEGY (this->orb_core_),
00460                   -1);
00461 
00462   ACE_NEW_RETURN (this->accept_strategy_,
00463                   TAO_IIOP_ACCEPT_STRATEGY (this->orb_core_),
00464                   -1);
00465 
00466   u_short requested_port = addr.get_port_number ();
00467   if (requested_port == 0)
00468     {
00469       // don't care, i.e., let the OS choose an ephemeral port
00470       if (this->base_acceptor_.open (addr,
00471                                      reactor,
00472                                      this->creation_strategy_,
00473                                      this->accept_strategy_,
00474                                      this->concurrency_strategy_) == -1)
00475         {
00476           if (TAO_debug_level > 0)
00477             ACE_DEBUG ((LM_DEBUG,
00478                         ACE_TEXT ("\n\nTAO (%P|%t) IIOP_Acceptor::open_i ")
00479                         ACE_TEXT ("- %p\n\n"),
00480                         ACE_TEXT ("cannot open acceptor")));
00481           return -1;
00482         }
00483     }
00484   else
00485     {
00486       ACE_INET_Addr a(addr);
00487 
00488       int found_a_port = 0;
00489       ACE_UINT32 last_port = requested_port + this->port_span_ - 1;
00490       if (last_port > ACE_MAX_DEFAULT_PORT)
00491         {
00492           last_port = ACE_MAX_DEFAULT_PORT;
00493         }
00494 
00495       for (ACE_UINT32 p = requested_port; p <= last_port; p++)
00496         {
00497           if (TAO_debug_level > 5)
00498             ACE_DEBUG ((LM_DEBUG,
00499                         ACE_TEXT ("TAO (%P|%t) IIOP_Acceptor::open_i() ")
00500                         ACE_TEXT ("trying to listen on port %d\n"), p));
00501 
00502           // Now try to actually open on that port
00503           a.set_port_number ((u_short)p);
00504           if (this->base_acceptor_.open (a,
00505                                          reactor,
00506                                          this->creation_strategy_,
00507                                          this->accept_strategy_,
00508                                          this->concurrency_strategy_) != -1)
00509             {
00510               found_a_port = 1;
00511               break;
00512             }
00513         }
00514 
00515       // Now, if we couldn't locate a port, we punt
00516       if (! found_a_port)
00517         {
00518           if (TAO_debug_level > 0)
00519             ACE_DEBUG ((LM_DEBUG,
00520                         ACE_TEXT ("\n\nTAO (%P|%t) IIOP_Acceptor::open_i ")
00521                         ACE_TEXT ("cannot open acceptor in port range (%d,%d)")
00522                         ACE_TEXT ("- %p\n\n"),
00523                         requested_port, last_port, ACE_TEXT("")));
00524           return -1;
00525         }
00526     }
00527 
00528   ACE_INET_Addr address;
00529 
00530   // We do this make sure the port number the endpoint is listening on
00531   // gets set in the addr.
00532   if (this->base_acceptor_.acceptor ().get_local_addr (address) != 0)
00533     {
00534       // @@ Should this be a catastrophic error???
00535       if (TAO_debug_level > 0)
00536         ACE_DEBUG ((LM_DEBUG,
00537                     ACE_TEXT ("\n\nTAO (%P|%t) IIOP_Acceptor::open_i ")
00538                     ACE_TEXT ("- %p\n\n"),
00539                     ACE_TEXT ("cannot get local addr")));
00540       return -1;
00541     }
00542 
00543   // Set the port for each addr.  If there is more than one network
00544   // interface then the endpoint created on each interface will be on
00545   // the same port.  This is how a wildcard socket bind() is supposed
00546   // to work.
00547   u_short port = address.get_port_number ();
00548   for (CORBA::ULong j = 0; j < this->endpoint_count_; ++j)
00549     this->addrs_[j].set_port_number (port, 1);
00550 
00551   (void) this->base_acceptor_.acceptor().enable (ACE_CLOEXEC);
00552   // This avoids having child processes acquire the listen socket thereby
00553   // denying the server the opportunity to restart on a well-known endpoint.
00554   // This does not affect the aberrent behavior on Win32 platforms.
00555 
00556   if (TAO_debug_level > 5)
00557     {
00558       for (CORBA::ULong i = 0; i < this->endpoint_count_; ++i)
00559         {
00560           ACE_DEBUG ((LM_DEBUG,
00561                       ACE_LIB_TEXT ("\nTAO (%P|%t) IIOP_Acceptor::open_i - ")
00562                       ACE_LIB_TEXT ("listening on: <%s:%u>\n"),
00563                       ACE_TEXT_CHAR_TO_TCHAR(this->hosts_[i]),
00564                       this->addrs_[i].get_port_number ()));
00565         }
00566     }
00567 
00568   return 0;
00569 }

int TAO_IIOP_Acceptor::parse_options const char *    options [protected, virtual]
 

Parse protocol specific options.

Currently supported: portspan -- specifies the range of ports over which the acceptor should scan looking for a free port (this is convenient for situations where you might normally use an ephemeral port but can't because you're behind a firewall and don't want to permit passage on all ephemeral ports)

Definition at line 818 of file IIOP_Acceptor.cpp.

References ACE_CString, ACE_ERROR_RETURN, ACE_MAX_DEFAULT_PORT, ACE_TEXT, ACE_OS::atoi, hostname_in_ior_, LM_ERROR, and port_span_.

Referenced by open, and open_default.

00819 {
00820   if (str == 0)
00821     return 0;  // No options to parse.  Not a problem.
00822 
00823   // Use an option format similar to the one used for CGI scripts in
00824   // HTTP URLs.
00825   // e.g.:  option1=foo&option2=bar
00826 
00827   ACE_CString options (str);
00828 
00829   size_t len = options.length ();
00830 
00831   const char option_delimiter = '&';
00832 
00833   // Count the number of options.
00834 
00835   CORBA::ULong option_count = 1;
00836   // Number of endpoints in the string  (initialized to 1).
00837 
00838   // Only check for endpoints after the protocol specification and
00839   // before the object key.
00840   for (size_t i = 0; i < len; ++i)
00841     if (options[i] == option_delimiter)
00842       option_count++;
00843 
00844   // The idea behind the following loop is to split the options into
00845   // (option, name) pairs.
00846   // For example,
00847   //    `option1=foo&option2=bar'
00848   // will be parsed into:
00849   //    `option1=foo'
00850   //    `option2=bar'
00851 
00852   int begin = 0;
00853   int end = -1;
00854 
00855   for (CORBA::ULong j = 0; j < option_count; ++j)
00856     {
00857       begin += end + 1;
00858 
00859       if (j < option_count - 1)
00860         end = options.find (option_delimiter, begin);
00861       else
00862         end = ACE_static_cast(CORBA::ULong, len)
00863                            - begin;  // Handle last endpoint differently
00864 
00865       if (end == begin)
00866         ACE_ERROR_RETURN ((LM_ERROR,
00867                            ACE_TEXT ("TAO (%P|%t) Zero length IIOP option.\n")),
00868                           -1);
00869       else if (end != ACE_CString::npos)
00870         {
00871           ACE_CString opt = options.substring (begin, end);
00872 
00873           int slot = opt.find ("=");
00874 
00875           if (slot == ACE_static_cast (int, len - 1)
00876               || slot == ACE_CString::npos)
00877             ACE_ERROR_RETURN ((LM_ERROR,
00878                                ACE_TEXT ("TAO (%P|%t) IIOP option <%s> is ")
00879                                ACE_TEXT ("missing a value.\n"),
00880                                opt.c_str ()),
00881                               -1);
00882 
00883           ACE_CString name = opt.substring (0, slot);
00884           ACE_CString value = opt.substring (slot + 1);
00885 
00886           if (name.length () == 0)
00887             ACE_ERROR_RETURN ((LM_ERROR,
00888                                ACE_TEXT ("TAO (%P|%t) Zero length IIOP ")
00889                                ACE_TEXT ("option name.\n")),
00890                               -1);
00891 
00892           if (name == "priority")
00893             {
00894               ACE_ERROR_RETURN ((LM_ERROR,
00895                                  ACE_TEXT ("TAO (%P|%t) Invalid IIOP endpoint format: ")
00896                                  ACE_TEXT ("endpoint priorities no longer supported. \n"),
00897                                  value.c_str ()),
00898                                 -1);
00899             }
00900           else if (name == "portspan")
00901             {
00902               int range = ACE_static_cast (int, ACE_OS::atoi (value.c_str ()));
00903               // @@ What's the lower bound on the range?  zero, or one?
00904               if (range < 1 || range > ACE_MAX_DEFAULT_PORT)
00905                 ACE_ERROR_RETURN ((LM_ERROR,
00906                                    ACE_TEXT ("TAO (%P|%t) Invalid IIOP endpoint ")
00907                                    ACE_TEXT ("portspan: <%s>\n")
00908                                    ACE_TEXT ("Valid range 1 -- %d\n"),
00909                                    value.c_str (), ACE_MAX_DEFAULT_PORT),
00910                                   -1);
00911 
00912               this->port_span_ = ACE_static_cast (u_short, range);
00913             }
00914           else if (name == "hostname_in_ior")
00915             {
00916               this->hostname_in_ior_ = value.rep ();
00917             }
00918           else
00919             ACE_ERROR_RETURN ((LM_ERROR,
00920                                ACE_TEXT ("TAO (%P|%t) Invalid IIOP option: <%s>\n"),
00921                                name.c_str ()),
00922                               -1);
00923         }
00924     }
00925   return 0;
00926 }

int TAO_IIOP_Acceptor::probe_interfaces TAO_ORB_Core   orb_core [protected]
 

Probe the system for available network interfaces, and initialize the <addrs_> array with an ACE_INET_Addr for each network interface. The port for each initialized ACE_INET_Addr will be set in the open_i() method. This method only gets invoked when no explicit hostname is provided in the specified endpoint.

Definition at line 646 of file IIOP_Acceptor.cpp.

References ACE_DEBUG, ACE_NEW_RETURN, ACE_TEXT, addrs_, endpoint_count_, ENOTSUP, ACE_INET_Addr::get_ip_address, ACE_Sock_Connect::get_ip_interfaces, hostname, hostname_in_ior_, INADDR_LOOPBACK, LM_DEBUG, LM_WARNING, ACE_OS_String::memset, and ACE_INET_Addr::set.

Referenced by open, and open_default.

00647 {
00648   // Extract the hostname for each network interface, and then cache
00649   // it.  The hostnames will then be used when creating a
00650   // TAO_IIOP_Profile for each endpoint setup on the probed
00651   // network interfaces.
00652   ACE_INET_Addr *if_addrs = 0;
00653   size_t if_cnt = 0;
00654 
00655   if (ACE::get_ip_interfaces (if_cnt,
00656                               if_addrs) != 0
00657       && errno != ENOTSUP)
00658     {
00659       // In the case where errno == ENOTSUP, if_cnt and if_addrs will
00660       // not be modified, and will each remain equal to zero.  This
00661       // causes the default interface to be used.
00662       return -1;
00663     }
00664 
00665   if (if_cnt == 0 || if_addrs == 0)
00666     {
00667       if (TAO_debug_level > 0)
00668         {
00669           ACE_DEBUG ((LM_WARNING,
00670                       ACE_TEXT ("TAO (%P|%t) Unable to probe network ")
00671                       ACE_TEXT ("interfaces.  Using default.\n")));
00672         }
00673 
00674       if_cnt = 1; // Force the network interface count to be one.
00675       delete [] if_addrs;
00676       ACE_NEW_RETURN (if_addrs,
00677                       ACE_INET_Addr[if_cnt],
00678                       -1);
00679     }
00680 
00681   // Scan for the loopback interface since it shouldn't be included in
00682   // the list of cached hostnames unless it is the only interface.
00683   size_t lo_cnt = 0;  // Loopback interface count
00684   for (size_t j = 0; j < if_cnt; ++j)
00685     if (if_addrs[j].get_ip_address () == INADDR_LOOPBACK)
00686       lo_cnt++;
00687 
00688   // The instantiation for this template is in
00689   // tao/IIOP_Connector.cpp.
00690   ACE_Auto_Basic_Array_Ptr<ACE_INET_Addr> safe_if_addrs (if_addrs);
00691 
00692   // If the loopback interface is the only interface then include it
00693   // in the list of interfaces to query for a hostname, otherwise
00694   // exclude it from the list.
00695   if (if_cnt == lo_cnt)
00696     this->endpoint_count_ = ACE_static_cast(CORBA::ULong, if_cnt);
00697   else
00698     this->endpoint_count_ = ACE_static_cast(CORBA::ULong, if_cnt - lo_cnt);
00699 
00700   ACE_NEW_RETURN (this->addrs_,
00701                   ACE_INET_Addr[this->endpoint_count_],
00702                   -1);
00703 
00704   ACE_NEW_RETURN (this->hosts_,
00705                   char *[this->endpoint_count_],
00706                   -1);
00707 
00708   ACE_OS::memset (this->hosts_, 0, sizeof (char*) * this->endpoint_count_);
00709 
00710   // The number of hosts/interfaces we want to cache may not be the
00711   // same as the number of detected interfaces so keep a separate
00712   // count.
00713   size_t host_cnt = 0;
00714 
00715   for (size_t i = 0; i < if_cnt; ++i)
00716     {
00717       // Ignore any loopback interface if there are other
00718       // non-loopback interfaces.
00719       if (if_cnt != lo_cnt &&
00720           if_addrs[i].get_ip_address() == INADDR_LOOPBACK)
00721         continue;
00722 
00723       if (this->hostname_in_ior_ != 0)
00724         {
00725           if (TAO_debug_level > 2)
00726             {
00727               ACE_DEBUG ((LM_DEBUG,
00728                           ACE_TEXT ("Overriding address in IOR with %s\n"),
00729                           this->hostname_in_ior_));
00730             }
00731           if (this->hostname (orb_core,
00732                               if_addrs[i],
00733                               this->hosts_[host_cnt],
00734                               this->hostname_in_ior_) != 0)
00735             return -1;
00736         }
00737       else
00738         {
00739           if (this->hostname (orb_core,
00740                               if_addrs[i],
00741                               this->hosts_[host_cnt]) != 0)
00742             return -1;
00743         }
00744 
00745       // Copy the addr.  The port is (re)set in
00746       // TAO_IIOP_Acceptor::open_i().
00747       if (this->addrs_[host_cnt].set (if_addrs[i]) != 0)
00748         return -1;
00749 
00750       host_cnt++;
00751     }
00752 
00753   return 0;
00754 }


Member Data Documentation

TAO_IIOP_ACCEPT_STRATEGY* TAO_IIOP_Acceptor::accept_strategy_ [private]
 

Definition at line 212 of file IIOP_Acceptor.h.

Referenced by ~TAO_IIOP_Acceptor.

ACE_INET_Addr* TAO_IIOP_Acceptor::addrs_ [protected]
 

Array of ACE_INET_Addr instances, each one corresponding to a given network interface.

Definition at line 160 of file IIOP_Acceptor.h.

Referenced by address, create_new_profile, create_shared_profile, endpoints, is_collocated, open, open_i, probe_interfaces, and ~TAO_IIOP_Acceptor.

TAO_IIOP_BASE_ACCEPTOR TAO_IIOP_Acceptor::base_acceptor_ [private]
 

the concrete acceptor, as a pointer to it's base class.

Definition at line 207 of file IIOP_Acceptor.h.

Referenced by close, and open_i.

TAO_IIOP_CONCURRENCY_STRATEGY* TAO_IIOP_Acceptor::concurrency_strategy_ [private]
 

Definition at line 211 of file IIOP_Acceptor.h.

Referenced by ~TAO_IIOP_Acceptor.

TAO_IIOP_CREATION_STRATEGY* TAO_IIOP_Acceptor::creation_strategy_ [private]
 

Acceptor strategies.

Definition at line 210 of file IIOP_Acceptor.h.

Referenced by ~TAO_IIOP_Acceptor.

CORBA::ULong TAO_IIOP_Acceptor::endpoint_count_ [protected]
 

The number of host names cached in the hosts_ array (equivalent to the number of endpoints opened by this Acceptor).

Definition at line 180 of file IIOP_Acceptor.h.

Referenced by create_new_profile, create_profile, create_shared_profile, endpoint_count, is_collocated, open, open_i, probe_interfaces, and ~TAO_IIOP_Acceptor.

char* TAO_IIOP_Acceptor::hostname_in_ior_ [protected]
 

Override the hostname used in the ORBEndPoint.

Definition at line 185 of file IIOP_Acceptor.h.

Referenced by open, parse_options, and probe_interfaces.

char** TAO_IIOP_Acceptor::hosts_ [protected]
 

Cache the information about the endpoints serviced by this acceptor. There may in fact be multiple hostnames for this endpoint. For example, if the IP address is INADDR_ANY (0.0.0.0) then there will be possibly a different hostname for each interface.

Definition at line 176 of file IIOP_Acceptor.h.

Referenced by is_collocated, open, open_default, and ~TAO_IIOP_Acceptor.

CORBA::Boolean TAO_IIOP_Acceptor::lite_flag_ [protected]
 

Should we use GIOP lite??

Definition at line 202 of file IIOP_Acceptor.h.

TAO_ORB_Core* TAO_IIOP_Acceptor::orb_core_ [protected]
 

ORB Core.

Definition at line 195 of file IIOP_Acceptor.h.

Referenced by create_new_profile, create_shared_profile, init_tcp_properties, open, and open_default.

u_short TAO_IIOP_Acceptor::port_span_ [protected]
 

The number of ports over which the acceptor should search (starting at the port specified in each element of addrs_) for an available port. This is specified via the "portspan=" option to the endpoint.

Definition at line 167 of file IIOP_Acceptor.h.

Referenced by open_i, and parse_options.

TAO_IIOP_Properties TAO_IIOP_Acceptor::tcp_properties_ [protected]
 

TCP configuration properties to be used for all connections opened by this acceptor.

Definition at line 199 of file IIOP_Acceptor.h.

Referenced by init_tcp_properties.

TAO_GIOP_Message_Version TAO_IIOP_Acceptor::version_ [protected]
 

The GIOP version for this endpoint @ Theoretically they shouldn't be here!! We need to look at a way to move this out

Definition at line 192 of file IIOP_Acceptor.h.

Referenced by create_new_profile, create_shared_profile, open, and open_default.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 15:18:42 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002