diff options
author | mjb2 <mjb2@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-08-19 23:05:27 +0000 |
---|---|---|
committer | mjb2 <mjb2@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-08-19 23:05:27 +0000 |
commit | 7857be1f1594e99d2d3b7dc1751e46269d7266f4 (patch) | |
tree | c2e054bf9cba9c77b2426965d373bc41e4483b47 | |
parent | eb0d3cc0f3810fac95637f3a799213b012c9d64a (diff) | |
download | ATCD-7857be1f1594e99d2d3b7dc1751e46269d7266f4.tar.gz |
See Wed Aug 19 17:54:13 1998 Matthew J Braun <mjb2@cec.wustl.edu>
-rw-r--r-- | TAO/ChangeLog-98c | 12 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/AVStreams/benchmark/client.cpp | 35 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/AVStreams/benchmark/client.h | 16 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/AVStreams/benchmark/server.cpp | 22 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/AVStreams/benchmark/server.h | 13 |
5 files changed, 64 insertions, 34 deletions
diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c index 78fe056e403..cd853dd31ce 100644 --- a/TAO/ChangeLog-98c +++ b/TAO/ChangeLog-98c @@ -1,7 +1,17 @@ +Wed Aug 19 17:54:13 1998 Matthew J Braun <mjb2@cec.wustl.edu> + + * orbsvcs/tests/AVStreams/benchmark/client.{h,cpp} + * orbsvcs/tests/AVStreams/benchmark/server.{h,cpp} + Added Naming_Utils code to simplify Naming Service + operations. Note: Due to multicast weirdness yet to be resolved + sometimes the Naming Service will not be properly detected. I + found that running the Naming Service and the server in the same + window helped. I added comments to that effect. + Wed Aug 19 17:37:51 1998 Nagarajan Surendran <naga@cs.wustl.edu> * orbsvcs/orbsvcs/Makefile: Integrated the Audio/video streams - stuff into the mainstream orbsvcs. + stuff into the mainstream orbsvcs. Wed Aug 19 17:32:40 1998 Matthew J Braun <mjb2@cec.wustl.edu> diff --git a/TAO/orbsvcs/tests/AVStreams/benchmark/client.cpp b/TAO/orbsvcs/tests/AVStreams/benchmark/client.cpp index 3a433ac1621..9a7f607e866 100644 --- a/TAO/orbsvcs/tests/AVStreams/benchmark/client.cpp +++ b/TAO/orbsvcs/tests/AVStreams/benchmark/client.cpp @@ -298,23 +298,34 @@ Client::bind_to_server (void) { TAO_TRY { - CORBA::Object_var naming_obj = - this->orb_manager_.orb ()->resolve_initial_references ("NameService"); - if (CORBA::is_nil (naming_obj.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to resolve the Name Service.\n"), - -1); - CosNaming::NamingContext_var naming_context = - CosNaming::NamingContext::_narrow (naming_obj.in (), - TAO_TRY_ENV); - TAO_CHECK_ENV; - + /* + CORBA::Object_var naming_obj = + this->orb_manager_.orb ()->resolve_initial_references ("NameService"); + if (CORBA::is_nil (naming_obj.in ())) + ACE_ERROR_RETURN ((LM_ERROR, + " (%P|%t) Unable to resolve the Name Service.\n"), + -1); + CosNaming::NamingContext_var naming_context = + CosNaming::NamingContext::_narrow (naming_obj.in (), + TAO_TRY_ENV); + TAO_CHECK_ENV; + */ + + // Initialize the naming services + if (my_name_client_.init (this->orb_manager_.orb (), + argc_, + argv_) != 0) + ACE_ERROR_RETURN ((LM_ERROR, + " (%P|%t) Unable to initialize " + "the TAO_Naming_Client. \n"), + -1); + CosNaming::Name server_mmdevice_name (1); server_mmdevice_name.length (1); server_mmdevice_name [0].id = CORBA::string_dup ("Bench_Server_MMDevice"); CORBA::Object_var server_mmdevice_obj = - naming_context->resolve (server_mmdevice_name, + my_name_client_->resolve (server_mmdevice_name, TAO_TRY_ENV); TAO_CHECK_ENV; diff --git a/TAO/orbsvcs/tests/AVStreams/benchmark/client.h b/TAO/orbsvcs/tests/AVStreams/benchmark/client.h index 5819213d018..390c2016b27 100644 --- a/TAO/orbsvcs/tests/AVStreams/benchmark/client.h +++ b/TAO/orbsvcs/tests/AVStreams/benchmark/client.h @@ -1,6 +1,9 @@ - +/* -*- C++ -*- */ // $Id$ +// NOTE: If you encounter trouble resolving the Naming Service, try +// running the Naming Service and the server in the same window. [MJB] + #if !defined (TAO_AV_BENCH_CLIENT_H) #define TAO_AV_BENCH_CLIENT_H @@ -14,6 +17,7 @@ #include "ace/SOCK_Acceptor.h" #include "ace/Synch.h" #include "ace/High_Res_Timer.h" +#include "orbsvcs/Naming/Naming_Utils.h" #define TCP_PORT 5000 @@ -41,13 +45,13 @@ public: // called after connecting virtual int handle_start (const AVStreams::flowSpec &the_spec, - CORBA::Environment &env) ; + CORBA::Environment &env) ; virtual int handle_stop (const AVStreams::flowSpec &the_spec, - CORBA::Environment &env) ; + CORBA::Environment &env) ; virtual int handle_destroy (const AVStreams::flowSpec &the_spec, - CORBA::Environment &env); + CORBA::Environment &env); }; @@ -92,7 +96,7 @@ class ttcp_Endpoint_Reactive_Strategy_A { public: ttcp_Endpoint_Reactive_Strategy_A (TAO_ORB_Manager *orb_manager, - Client *client_ptr); + Client *client_ptr); // constructor . The orb manager is needed for the TAO_AV_Endpoint_Reactive_Strategy_A. virtual int make_stream_endpoint (ttcp_Client_StreamEndPoint *& endpoint); @@ -122,6 +126,8 @@ private: TAO_ORB_Manager orb_manager_; + TAO_Naming_Client my_name_client_; + // ttcp_Endpoint_Reactive_Strategy_A reactive_strategy_; TAO_AV_Endpoint_Reactive_Strategy_A<Client_StreamEndPoint,TAO_VDev,AV_Null_MediaCtrl> reactive_strategy_; diff --git a/TAO/orbsvcs/tests/AVStreams/benchmark/server.cpp b/TAO/orbsvcs/tests/AVStreams/benchmark/server.cpp index dfa53b8c919..f23798a9194 100644 --- a/TAO/orbsvcs/tests/AVStreams/benchmark/server.cpp +++ b/TAO/orbsvcs/tests/AVStreams/benchmark/server.cpp @@ -143,19 +143,13 @@ Server::init (int argc, PortableServer::POA_var child_poa = this->orb_manager_.child_poa (); - // Resolve the Naming service reference. - - CORBA::Object_var naming_obj = orb->resolve_initial_references ("NameService"); - if (CORBA::is_nil (naming_obj.in ())) + // Initialize the naming services + if (my_name_client_.init (orb, argc, argv) != 0) ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to resolve the Name Service.\n"), - -1); - - this->naming_context_ = - CosNaming::NamingContext::_narrow (naming_obj.in (), - env); - TAO_CHECK_ENV_RETURN (env,-1); - + " (%P|%t) Unable to initialize " + "the TAO_Naming_Client. \n"), + -1); + // Register the video mmdevice object with the ORB ACE_NEW_RETURN (this->mmdevice_, // TAO_MMDevice (&this->process_strategy_), @@ -174,14 +168,14 @@ Server::init (int argc, server_mmdevice_name [0].id = CORBA::string_dup ("Bench_Server_MMDevice"); // Register the video control object with the naming server. - this->naming_context_->bind (server_mmdevice_name, + this->my_name_client_->bind (server_mmdevice_name, this->mmdevice_->_this (env), env); if (env.exception () != 0) { env.clear (); - this->naming_context_->rebind (server_mmdevice_name, + this->my_name_client_->rebind (server_mmdevice_name, this->mmdevice_->_this (env), env); TAO_CHECK_ENV_RETURN (env,-1); diff --git a/TAO/orbsvcs/tests/AVStreams/benchmark/server.h b/TAO/orbsvcs/tests/AVStreams/benchmark/server.h index db539184ae5..5c1f22b581e 100644 --- a/TAO/orbsvcs/tests/AVStreams/benchmark/server.h +++ b/TAO/orbsvcs/tests/AVStreams/benchmark/server.h @@ -1,5 +1,11 @@ +/* -*- C++ -*- */ // $Id$ + +// NOTE: If you encounter trouble resolving the Naming Service, try +// running the Naming Service and the server in the same window. [MJB] + + #if !defined (TAO_AV_BENCH_SERVER_H) #define TAO_AV_BENCH_SERVER_H @@ -66,7 +72,10 @@ private: TAO_ORB_Manager orb_manager_; // the TAO ORB manager. - CosNaming::NamingContext_var naming_context_; + TAO_Naming_Client my_name_client_; + // The TAO Naming server + + //CosNaming::NamingContext_var naming_context_; // The root naming context of the naming service // AV_Server_Sig_Handler signal_handler_; @@ -77,7 +86,7 @@ private: // TAO_AV_Endpoint_Process_Strategy_B process_strategy_; // The proces strategy for the video. - TAO_AV_Endpoint_Reactive_Strategy_B<Bench_Server_StreamEndPoint,TAO_VDev,AV_Null_MediaCtrl> reactive_strategy_; + TAO_AV_Endpoint_Reactive_Strategy_B <Bench_Server_StreamEndPoint,TAO_VDev,AV_Null_MediaCtrl> reactive_strategy_; // Reactive strategy TAO_MMDevice *mmdevice_; |