diff options
author | Benoit Foucher <benoit@zeroc.com> | 2005-09-27 13:20:42 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2005-09-27 13:20:42 +0000 |
commit | c34bc48eec91d5e0934bf9f0b8650044ef1d8a4e (patch) | |
tree | b11203f59335d90c6383279385be759e85f0a92a /cpp/demo/IceGrid/simple/Client.cpp | |
parent | Added /Zm200 to all configurations. (diff) | |
download | ice-c34bc48eec91d5e0934bf9f0b8650044ef1d8a4e.tar.bz2 ice-c34bc48eec91d5e0934bf9f0b8650044ef1d8a4e.tar.xz ice-c34bc48eec91d5e0934bf9f0b8650044ef1d8a4e.zip |
Fixes
Diffstat (limited to 'cpp/demo/IceGrid/simple/Client.cpp')
-rw-r--r-- | cpp/demo/IceGrid/simple/Client.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/cpp/demo/IceGrid/simple/Client.cpp b/cpp/demo/IceGrid/simple/Client.cpp index a030d7f269b..b2f9fa70503 100644 --- a/cpp/demo/IceGrid/simple/Client.cpp +++ b/cpp/demo/IceGrid/simple/Client.cpp @@ -46,29 +46,22 @@ HelloClient::menu() int HelloClient::run(int argc, char* argv[]) { - Ice::PropertiesPtr properties = communicator()->getProperties(); - - Ice::StringSeq args = Ice::argsToStringSeq(argc, argv); - args = properties->parseCommandLineOptions("", args); - Ice::stringSeqToArgs(args, argc, argv); - // // First we try to connect to the object with the `hello' // identity. If it's not registered with the registry, we // search for an object with the ::Demo::Hello type. // - Ice::ObjectPrx base = communicator()->stringToProxy(properties->getPropertyWithDefault("Identity", "hello")); - HelloPrx twoway; + HelloPrx hello; try { - twoway = HelloPrx::checkedCast(base); + hello = HelloPrx::checkedCast(communicator()->stringToProxy("hello")); } catch(const Ice::NotRegisteredException&) { - IceGrid::QueryPrx query = IceGrid::QueryPrx::uncheckedCast(communicator()->stringToProxy("IceGrid/Query")); - twoway = HelloPrx::checkedCast(query->findObjectByType("::Demo::Hello")); + IceGrid::QueryPrx query = IceGrid::QueryPrx::checkedCast(communicator()->stringToProxy("IceGrid/Query")); + hello = HelloPrx::checkedCast(query->findObjectByType("::Demo::Hello")); } - if(!twoway) + if(!hello) { cerr << argv[0] << ": couldn't find a `::Demo::Hello' object." << endl; return EXIT_FAILURE; @@ -85,11 +78,11 @@ HelloClient::run(int argc, char* argv[]) cin >> c; if(c == 't') { - twoway->sayHello(); + hello->sayHello(); } else if(c == 's') { - twoway->shutdown(); + hello->shutdown(); } else if(c == 'x') { |