diff options
author | Benoit Foucher <benoit@zeroc.com> | 2006-02-10 16:41:42 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2006-02-10 16:41:42 +0000 |
commit | 5d0005ecc2e7b0b468ef49297a02cf5ec8fd31fe (patch) | |
tree | 09583bad00eb87888e2881d4abd58b2d05ac2344 /cpp/test/Ice/binding/Server.cpp | |
parent | Changed Ice-E version to 1.1.0 (diff) | |
download | ice-5d0005ecc2e7b0b468ef49297a02cf5ec8fd31fe.tar.bz2 ice-5d0005ecc2e7b0b468ef49297a02cf5ec8fd31fe.tar.xz ice-5d0005ecc2e7b0b468ef49297a02cf5ec8fd31fe.zip |
- Added ice_cacheConnection, ice_endpointSelection proxy methods.
- Added binding test.
Diffstat (limited to 'cpp/test/Ice/binding/Server.cpp')
-rw-r--r-- | cpp/test/Ice/binding/Server.cpp | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/cpp/test/Ice/binding/Server.cpp b/cpp/test/Ice/binding/Server.cpp new file mode 100644 index 00000000000..143c58cb3f8 --- /dev/null +++ b/cpp/test/Ice/binding/Server.cpp @@ -0,0 +1,59 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#include <Ice/Ice.h> +#include <TestI.h> + +using namespace std; + +int +run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) +{ + communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12345 -t 10000:udp"); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); + Ice::Identity id = Ice::stringToIdentity("communicator"); + adapter->add(new RemoteCommunicatorI(), id); + 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; +} |