当前位置: 首页>>代码示例>>C++>>正文


C++ Communicator::createObjectAdapterWithEndpoint方法代码示例

本文整理汇总了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;
}
开发者ID:wuhua988,项目名称:icm,代码行数:16,代码来源:server.cpp

示例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;
}
开发者ID:wuhua988,项目名称:icm,代码行数:24,代码来源:AmhServer.cpp

示例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;
}
开发者ID:wuhua988,项目名称:icm,代码行数:24,代码来源:MySubscriber.cpp


注:本文中的Communicator::createObjectAdapterWithEndpoint方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。