本文整理汇总了C++中Communicator::createObjectAdapterWithEndpoint方法的典型用法代码示例。如果您正苦于以下问题:C++ Communicator::createObjectAdapterWithEndpoint方法的具体用法?C++ Communicator::createObjectAdapterWithEndpoint怎么用?C++ Communicator::createObjectAdapterWithEndpoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Communicator
的用法示例。
在下文中一共展示了Communicator::createObjectAdapterWithEndpoint方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: endpoint
int
main (int argc, char* argv[])
{
Communicator* comm = Communicator::instance();
if (comm->init () == -1)
return -1;
Endpoint endpoint ("TCP", "", 3000);
ObjectAdapter* oa = comm->createObjectAdapterWithEndpoint ("MyHello", &endpoint);
Object* object = new demo::MyHelloI;
oa->add (object, "MyHello");
comm->run ();
return 0;
}
示例2: endpoint
int
main (int argc, char* argv[])
{
Communicator* comm = Communicator::instance();
if (comm->init () == -1)
return -1;
demo::DelayResponse* task = new demo::DelayResponse;
Endpoint endpoint ("TCP", "", 3000);
ObjectAdapter* oa = comm->createObjectAdapterWithEndpoint ("MyHello", &endpoint);
demo::AmhMyHelloI* amh = new demo::AmhMyHelloI;
amh->set(task);
oa->add (amh, "MyHello");
task->activate();
comm->run ();
delete task;
return 0;
}
示例3: ref
int
Subscriber::run(int argc, char* argv[]) {
Communicator* comm = Communicator::instance();
if (comm->init (true) == -1)
return -1;
Reference ref (comm, Identity("TopicManager"), Endpoint("TCP", "127.0.0.1", 5555));
IcmProxy::IcmMsg::TopicManager topicManager;
topicManager.setReference (&ref);
ObjectAdapter* adapter = comm->createObjectAdapterWithEndpoint("Subscriber", "127.0.0.1 8888");
IcmProxy::Object* networkProxy = adapter->add(new NetworkI(), "NetworkTopic");
::IcmProxy::IcmMsg::Topic* topic = topicManager.retrieve("NetworkTopic");
if(topic == 0)
topic = topicManager.create("NetworkTopic");
if (topic == 0)
return -1;
topic->subscribe(networkProxy);
comm->run();
return 0;
}