diff options
author | Marc Laukien <marc@zeroc.com> | 2001-10-22 15:54:56 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2001-10-22 15:54:56 +0000 |
commit | bbe924f6c28a0519e54fdadab0470cc8819d9c96 (patch) | |
tree | a8cfd140006c6287c0923eda2ab5f237cdf1d7b3 /cpp/test/Ice/objects/Server.cpp | |
parent | fixed value demo (diff) | |
download | ice-bbe924f6c28a0519e54fdadab0470cc8819d9c96.tar.bz2 ice-bbe924f6c28a0519e54fdadab0470cc8819d9c96.tar.xz ice-bbe924f6c28a0519e54fdadab0470cc8819d9c96.zip |
started with objects test
Diffstat (limited to 'cpp/test/Ice/objects/Server.cpp')
-rw-r--r-- | cpp/test/Ice/objects/Server.cpp | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/cpp/test/Ice/objects/Server.cpp b/cpp/test/Ice/objects/Server.cpp new file mode 100644 index 00000000000..c329c1c3049 --- /dev/null +++ b/cpp/test/Ice/objects/Server.cpp @@ -0,0 +1,59 @@ +// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#include <Ice/Ice.h> +#include <TestI.h> + +using namespace std; + +int +run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) +{ + string endpts("tcp -p 12345 -t 2000"); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("TestAdapter", endpts); + InitialPtr initial = new InitialI(adapter); + adapter->add(initial, "initial"); + 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; +} |