~ubuntu-branches/ubuntu/quantal/zeroc-ice/quantal

« back to all changes in this revision

Viewing changes to cpp/test/Glacier2/override/Server.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Cleto Martín
  • Date: 2011-06-25 19:44:26 UTC
  • mfrom: (6.1.16 sid)
  • Revision ID: james.westby@ubuntu.com-20110625194426-9fip3u3hlwheohvl
Tags: 3.4.2-1
New upstream release (Closes: #631456).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// **********************************************************************
 
2
//
 
3
// Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
 
4
//
 
5
// This copy of Ice is licensed to you under the terms described in the
 
6
// ICE_LICENSE file included in this distribution.
 
7
//
 
8
// **********************************************************************
 
9
 
 
10
#include <Ice/Application.h>
 
11
#include <CallbackI.h>
 
12
 
 
13
using namespace std;
 
14
using namespace Ice;
 
15
using namespace Test;
 
16
 
 
17
class CallbackServer : public Application
 
18
{
 
19
public:
 
20
 
 
21
    virtual int run(int, char*[]);
 
22
};
 
23
 
 
24
int
 
25
main(int argc, char* argv[])
 
26
{
 
27
    Ice::InitializationData initData;
 
28
    initData.properties = Ice::createProperties(argc, argv);
 
29
 
 
30
    initData.properties->setProperty("Ice.Warn.Connections", "0");
 
31
    initData.properties->setProperty("Ice.Warn.Dispatch", "0");
 
32
    initData.properties->setProperty("Ice.ThreadPool.Server.Serialize", "1");
 
33
 
 
34
    CallbackServer app;
 
35
    return app.main(argc, argv, initData);
 
36
}
 
37
 
 
38
int
 
39
CallbackServer::run(int argc, char* argv[])
 
40
{
 
41
    communicator()->getProperties()->setProperty("CallbackAdapter.Endpoints", "tcp -p 12010");
 
42
    ObjectAdapterPtr adapter = communicator()->createObjectAdapter("CallbackAdapter");
 
43
    adapter->add(new CallbackI(), communicator()->stringToIdentity("c/callback"));
 
44
    adapter->activate();
 
45
    communicator()->waitForShutdown();
 
46
    return EXIT_SUCCESS;
 
47
}