本文整理汇总了C++中ice::CommunicatorHolder::communicator方法的典型用法代码示例。如果您正苦于以下问题:C++ CommunicatorHolder::communicator方法的具体用法?C++ CommunicatorHolder::communicator怎么用?C++ CommunicatorHolder::communicator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ice::CommunicatorHolder
的用法示例。
在下文中一共展示了CommunicatorHolder::communicator方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rc
int
main(int argc, char* argv[])
{
#ifdef ICE_STATIC_LIBS
Ice::registerIceSSL();
# if defined(__linux)
Ice::registerIceBT();
# endif
#endif
try
{
Ice::InitializationData initData;
initData.properties = Ice::createProperties(argc, argv);
initData.properties->setProperty("Ice.Warn.Connections", "0");
initData.properties->setProperty("Ice.MessageSizeMax", "10"); // 10KB max
Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
RemoteConfig rc("Ice/exceptions", argc, argv, ich.communicator());
int status = run(argc, argv, ich.communicator());
rc.finished(status);
return status;
}
catch(const Ice::Exception& ex)
{
cerr << ex << endl;
return EXIT_FAILURE;
}
}
示例2: run
int
main(int argc, char* argv[])
{
#ifdef ICE_STATIC_LIBS
Ice::registerIceSSL();
#endif
try
{
//
// In this test, we need a longer server idle time, otherwise
// our test servers may time out before they are used in the
// test.
//
Ice::InitializationData initData;
initData.properties = Ice::createProperties(argc, argv);
initData.properties->setProperty("Ice.ServerIdleTime", "120"); // Two minutes.
Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
{
cerr << ex << endl;
return EXIT_FAILURE;
}
}
示例3: run
int
main(int argc, char* argv[])
{
#ifdef ICE_STATIC_LIBS
Ice::registerIceSSL();
#endif
try
{
Ice::InitializationData initData;
initData.properties = Ice::createProperties(argc, argv);
//
// Its possible to have batch oneway requests dispatched after
// the adapter is deactivated due to thread scheduling so we
// supress this warning.
//
initData.properties->setProperty("Ice.Warn.Dispatch", "0");
Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
{
cerr << ex << endl;
return EXIT_FAILURE;
}
}
示例4: run
int
main(int argc, char* argv[])
{
try
{
Ice::InitializationData initData;
initData.properties = Ice::createProperties(argc, argv);
//
// This test kills connections, so we don't want warnings.
//
initData.properties->setProperty("Ice.Warn.Connections", "0");
initData.properties->setProperty("Ice.MessageSizeMax", "50000");
// This test relies on filling the TCP send/recv buffer, so
// we rely on a fixed value for these buffers.
initData.properties->setProperty("Ice.TCP.RcvSize", "50000");
//
// Setup the test transport plug-in.
//
initData.properties->setProperty("Ice.Plugin.Test", "TestTransport:createTestTransport");
string defaultProtocol = initData.properties->getPropertyWithDefault("Ice.Default.Protocol", "tcp");
initData.properties->setProperty("Ice.Default.Protocol", "test-" + defaultProtocol);
Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
{
cerr << ex << endl;
return EXIT_FAILURE;
}
}
示例5: rc
int
main(int argc, char* argv[])
{
#ifdef ICE_STATIC_LIBS
Ice::registerIceSSL();
# if defined(__linux)
Ice::registerIceBT();
# endif
#endif
try
{
Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
RemoteConfig rc("Ice/proxy", argc, argv, ich.communicator());
int status = run(argc, argv, ich.communicator());
rc.finished(status);
return status;
}
catch(const Ice::Exception& ex)
{
cerr << ex << endl;
return EXIT_FAILURE;
}
}
示例6: run
int
main(int argc, char* argv[])
{
#ifdef ICE_STATIC_LIBS
Ice::registerIceSSL();
#endif
try
{
Ice::InitializationData initData;
initData.properties = Ice::createProperties(argc, argv);
Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
assert(initData.properties != ich->getProperties());
return run(argc, argv, ich.communicator(), initData);
}
catch(const Ice::Exception& ex)
{
cerr << ex << endl;
return EXIT_FAILURE;
}
}
示例7: run
int
main(int argc, char* argv[])
{
#ifdef ICE_STATIC_LIBS
Ice::registerIceSSL();
#endif
try
{
Ice::InitializationData initData;
initData.properties = Ice::createProperties(argc, argv);
#if TARGET_OS_IPHONE != 0
//
// COMPILERFIX: Disable connect timeout introduced for
// workaround to iOS device hangs when using SSL
//
initData.properties->setProperty("Ice.Override.ConnectTimeout", "");
#endif
//
// This test kills connections, so we don't want warnings.
//
initData.properties->setProperty("Ice.Warn.Connections", "0");
//
// Limit the recv buffer size, this test relies on the socket
// send() blocking after sending a given amount of data.
//
initData.properties->setProperty("Ice.TCP.RcvSize", "50000");
Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
{
cerr << ex << endl;
return EXIT_FAILURE;
}
}
示例8: run
int
main(int argc, char* argv[])
{
#ifdef ICE_STATIC_LIBS
Ice::registerIceSSL();
#endif
try
{
initCounts();
Ice::InitializationData initData;
initData.properties = Ice::createProperties(argc, argv);
initData.observer = getObserver();
//
// This test kills connections, so we don't want warnings.
//
initData.properties->setProperty("Ice.Warn.Connections", "0");
initData.properties->setProperty("Ice.RetryIntervals", "0 1 10 1");
Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
//
// Configure a second communicator for the invocation timeout
// + retry test, we need to configure a large retry interval
// to avoid time-sensitive failures.
//
Ice::InitializationData initData2;
initData2.properties = initData.properties->clone();
initData2.properties->setProperty("Ice.RetryIntervals", "0 1 10000");
initData2.observer = getObserver();
Ice::CommunicatorHolder ich2 = Ice::initialize(initData2);
return run(argc, argv, ich.communicator(), ich2.communicator());
}
catch(const Ice::Exception& ex)
{
cerr << ex << endl;
return EXIT_FAILURE;
}
}
示例9: Dispatcher
int
main(int argc, char* argv[])
{
#ifdef ICE_STATIC_LIBS
Ice::registerIceSSL();
#endif
int status;
try
{
Ice::InitializationData initData;
initData.properties = Ice::createProperties(argc, argv);
//
// Limit the recv buffer size, this test relies on the socket
// send() blocking after sending a given amount of data.
//
initData.properties->setProperty("Ice.TCP.RcvSize", "50000");
#ifdef ICE_CPP11_MAPPING
Ice::DispatcherPtr dispatcher = new Dispatcher();
initData.dispatcher = [=](function<void ()> call, const shared_ptr<Ice::Connection>& conn)
{
dispatcher->dispatch(new DispatcherCall(call), conn);
};
#else
initData.dispatcher = new Dispatcher();
#endif
Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
status = run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
{
cerr << ex << endl;
status = EXIT_FAILURE;
}
Dispatcher::terminate();
return status;
}