diff options
author | marina <marina@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-10-11 23:58:14 +0000 |
---|---|---|
committer | marina <marina@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-10-11 23:58:14 +0000 |
commit | fd050e088f3730aa3f918d422b4e72c9ef608e90 (patch) | |
tree | 391664d88f54bd3530a478e185548578eeb5099f | |
parent | acac18d5c32383b47dabb31bd91c823a17bef138 (diff) | |
download | ATCD-fd050e088f3730aa3f918d422b4e72c9ef608e90.tar.gz |
*** empty log message ***
-rw-r--r-- | TAO/ChangeLog-98c | 5 | ||||
-rw-r--r-- | TAO/orbsvcs/Naming_Service/Naming_Service.cpp | 24 | ||||
-rw-r--r-- | TAO/orbsvcs/Naming_Service/Naming_Service.h | 5 | ||||
-rw-r--r-- | TAO/orbsvcs/Naming_Service/README | 4 |
4 files changed, 31 insertions, 7 deletions
diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c index af6158851b9..4bab7154659 100644 --- a/TAO/ChangeLog-98c +++ b/TAO/ChangeLog-98c @@ -1,5 +1,10 @@ 1998-10-11 Marina Igorevna Spivak <marina@mambo.cs.wustl.edu> + * orbsvcs/Naming_Service/Naming_Service.{h, cpp}, README: Added a + command line option to specify how long a service should run + before shutting down. This is useful for running purify, + quantify, or avoiding having explicitly kill the process. + * orbsvcs/orbsvcs/CosNaming_i.{h,cpp}: Removed several memory allocations (in <get_context>, and <resolve>). diff --git a/TAO/orbsvcs/Naming_Service/Naming_Service.cpp b/TAO/orbsvcs/Naming_Service/Naming_Service.cpp index 1baa51e796d..26de1cf5513 100644 --- a/TAO/orbsvcs/Naming_Service/Naming_Service.cpp +++ b/TAO/orbsvcs/Naming_Service/Naming_Service.cpp @@ -25,7 +25,8 @@ ACE_RCSID(Naming_Service, Naming_Service, "$Id$") TAO_Naming_Service::TAO_Naming_Service (void) : ior_output_file_ (0), pid_file_name_ (0), - context_size_ (ACE_DEFAULT_MAP_SIZE) + context_size_ (ACE_DEFAULT_MAP_SIZE), + time_ (0) { } @@ -35,7 +36,8 @@ TAO_Naming_Service::TAO_Naming_Service (int argc, char* argv[]) : ior_output_file_ (0), pid_file_name_ (0), - context_size_ (ACE_DEFAULT_MAP_SIZE) + context_size_ (ACE_DEFAULT_MAP_SIZE), + time_ (0) { this->init (argc, argv); } @@ -44,9 +46,9 @@ int TAO_Naming_Service::parse_args (int argc, char *argv[]) { - ACE_Get_Opt get_opts (argc, argv, "do:p:s:"); + ACE_Get_Opt get_opts (argc, argv, "do:p:s:t:"); int c; - int size; + int size, time; while ((c = get_opts ()) != -1) switch (c) @@ -71,6 +73,11 @@ TAO_Naming_Service::parse_args (int argc, if (size >= 0) this->context_size_ = size; break; + case 't': + time = ACE_OS::atoi (get_opts.optarg); + if (time >= 0) + this->time_ = time; + break; case '?': default: ACE_ERROR_RETURN ((LM_ERROR, @@ -160,8 +167,13 @@ TAO_Naming_Service::init (int argc, int TAO_Naming_Service::run (CORBA_Environment& env) { - ACE_Time_Value * time_ = new ACE_Time_Value (180); - return this->orb_manager_.run (env, time_); + if (time_ == 0) + return this->orb_manager_.run (env); + else + { + ACE_Time_Value * t = new ACE_Time_Value (time_); + return this->orb_manager_.run (env, t); + } } // Destructor. diff --git a/TAO/orbsvcs/Naming_Service/Naming_Service.h b/TAO/orbsvcs/Naming_Service/Naming_Service.h index 48d84baddfd..6ef6ee9e3f4 100644 --- a/TAO/orbsvcs/Naming_Service/Naming_Service.h +++ b/TAO/orbsvcs/Naming_Service/Naming_Service.h @@ -68,6 +68,11 @@ private: // Service context (if one is created). Note: all the contexts // created under the given context will use the same size for their // initial hash table allocations. + + size_t time_; + // After how long the server should stop listening to requests (in + // seconds). + }; #endif /* TAO_NAMING_SERVICE_H */ diff --git a/TAO/orbsvcs/Naming_Service/README b/TAO/orbsvcs/Naming_Service/README index 88cc4b3464a..1095b5e7aae 100644 --- a/TAO/orbsvcs/Naming_Service/README +++ b/TAO/orbsvcs/Naming_Service/README @@ -12,7 +12,8 @@ To Run: ====== % Naming_Service [-ORBport port] [-ORBobjrefstyle url] - [-ORBnameserviceport nsport] [-s context_size] + [-ORBnameserviceport nsport] + [-s context_size] [-t time] Arguments: ========== @@ -22,6 +23,7 @@ Arguments: creation of the root Naming Context (if one is created). (All contexts created under the root will use the same size for their hash tables). + time - how long the server should listen for requests before exiting. Environment Variables: ===================== |