diff options
author | Marc Laukien <marc@zeroc.com> | 2002-12-06 16:36:08 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2002-12-06 16:36:08 +0000 |
commit | fda53102d9aa6ef19694e1b8c0b001cd3aae529e (patch) | |
tree | 149a69163e0d631e826ab5b3cb49e32fe9e39d24 /cpp/test/Ice/exceptions/ServerAMD.cpp | |
parent | Initial addition (diff) | |
download | ice-fda53102d9aa6ef19694e1b8c0b001cd3aae529e.tar.bz2 ice-fda53102d9aa6ef19694e1b8c0b001cd3aae529e.tar.xz ice-fda53102d9aa6ef19694e1b8c0b001cd3aae529e.zip |
amd merge
Diffstat (limited to 'cpp/test/Ice/exceptions/ServerAMD.cpp')
-rw-r--r-- | cpp/test/Ice/exceptions/ServerAMD.cpp | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/cpp/test/Ice/exceptions/ServerAMD.cpp b/cpp/test/Ice/exceptions/ServerAMD.cpp new file mode 100644 index 00000000000..17688f84f5a --- /dev/null +++ b/cpp/test/Ice/exceptions/ServerAMD.cpp @@ -0,0 +1,65 @@ +// ********************************************************************** +// +// Copyright (c) 2002 +// ZeroC, Inc. +// Billerica, MA, USA +// +// All Rights Reserved. +// +// Ice is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License version 2 as published by +// the Free Software Foundation. +// +// ********************************************************************** + +#include <Ice/Ice.h> +#include <TestAMDI.h> + +using namespace std; + +int +run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) +{ + Ice::PropertiesPtr properties = communicator->getProperties(); + properties->setProperty("Ice.Warn.Dispatch", "0"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12345 -t 2000"); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); + Ice::ObjectPtr object = new ThrowerI(adapter); + adapter->add(object, Ice::stringToIdentity("thrower")); + adapter->activate(); + communicator->waitForShutdown(); + return EXIT_SUCCESS; +} + +int +main(int argc, char* argv[]) +{ + int status; + Ice::CommunicatorPtr communicator; + + try + { + communicator = Ice::initialize(argc, argv); + status = run(argc, argv, communicator); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } + + if(communicator) + { + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } + } + + return status; +} |