summaryrefslogtreecommitdiff
path: root/cpp/demo/book/printer/Client.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2010-01-05 20:17:33 -0800
committerMark Spruiell <mes@zeroc.com>2010-01-05 20:17:33 -0800
commitcf24e681e8c52cd20d81fe750ff258e67ee65734 (patch)
tree8411820ce3a257272d6ffa0d3dcdab9ce106609a /cpp/demo/book/printer/Client.cpp
parentFixed bug 4576 - add NPTL options only on Rhel4 (diff)
downloadice-cf24e681e8c52cd20d81fe750ff258e67ee65734.tar.bz2
ice-cf24e681e8c52cd20d81fe750ff258e67ee65734.tar.xz
ice-cf24e681e8c52cd20d81fe750ff258e67ee65734.zip
bug 4495 - clean up book demos
Diffstat (limited to 'cpp/demo/book/printer/Client.cpp')
-rw-r--r--cpp/demo/book/printer/Client.cpp28
1 files changed, 19 insertions, 9 deletions
diff --git a/cpp/demo/book/printer/Client.cpp b/cpp/demo/book/printer/Client.cpp
index e7190622a6b..7a2d07297e0 100644
--- a/cpp/demo/book/printer/Client.cpp
+++ b/cpp/demo/book/printer/Client.cpp
@@ -18,26 +18,36 @@ main(int argc, char * argv[])
{
int status = 0;
Ice::CommunicatorPtr ic;
- try {
+ try
+ {
ic = Ice::initialize(argc, argv);
- Ice::ObjectPrx base = ic->stringToProxy(
- "SimplePrinter:default -p 10000");
+ Ice::ObjectPrx base = ic->stringToProxy("SimplePrinter:default -p 10000");
PrinterPrx printer = PrinterPrx::checkedCast(base);
- if (!printer)
+ if(!printer)
+ {
throw "Invalid proxy";
+ }
printer->printString("Hello World!");
- } catch (const Ice::Exception & ex) {
+ }
+ catch(const Ice::Exception& ex)
+ {
cerr << ex << endl;
status = 1;
- } catch (const char * msg) {
+ }
+ catch(const char* msg)
+ {
cerr << msg << endl;
status = 1;
}
- if (ic) {
- try {
+ if(ic)
+ {
+ try
+ {
ic->destroy();
- } catch (const Ice::Exception & ex) {
+ }
+ catch (const Ice::Exception& ex)
+ {
cerr << ex << endl;
status = 1;
}