⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pushconsumer.cpp

📁 这是广泛使用的通信开源项目,对于大容量,高并发的通讯要求完全能够胜任,他广泛可用于网络游戏医学图像网关的高qos要求.更详细的内容可阅读相应的材料
💻 CPP
字号:
// PushConsumer.cpp,v 1.4 2003/12/03 15:14:49 jwillemsen Exp

#include "ace/OS_NS_sys_time.h"
#include "PushConsumer.h"
#include "orbsvcs/FtRtEvent/Utils/resolve_init.h"
#include <stdio.h>

ACE_RCSID (FtRtEvent,
           PushConsumer,
           "PushConsumer.cpp,v 1.4 2003/12/03 15:14:49 jwillemsen Exp")

PushConsumer_impl::PushConsumer_impl(CORBA::ORB_ptr orb)
: orb_(CORBA::ORB::_duplicate(orb))
{
}


void
PushConsumer_impl::push (const RtecEventComm::EventSet & event
             ACE_ENV_ARG_DECL_NOT_USED
             )
             ACE_THROW_SPEC ((
             CORBA::SystemException
             ))
{
  CORBA::ULong x;
  ACE_Time_Value time_val = ACE_OS::gettimeofday ();

  if (event.length() >0) {
    TimeBase::TimeT elaps =
      time_val.sec () * 10000000 + time_val.usec ()* 10 - event[0].header.ec_send_time;
    event[0].data.any_value >>= x;
    printf("Received data : %d,  single trip time = %d usec\n", x, static_cast<int>(elaps/10));
  }
}


void
PushConsumer_impl::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
                       ACE_THROW_SPEC ((
                       CORBA::SystemException
                       ))
{
  PortableServer::Current_var current =
    resolve_init<PortableServer::Current>(orb_.in(), "POACurrent" ACE_ENV_ARG_PARAMETER);
  ACE_CHECK;

  PortableServer::POA_var poa = current->get_POA(ACE_ENV_SINGLE_ARG_PARAMETER);
  ACE_CHECK;

  PortableServer::ObjectId_var oid = current->get_object_id(ACE_ENV_SINGLE_ARG_PARAMETER);
  ACE_CHECK;

  poa->deactivate_object(oid ACE_ENV_ARG_PARAMETER);

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -