test1
来源:互联网 发布:md5 解密数据库 下载 编辑:程序博客网 时间:2024/06/07 00:21
#include "ace/Profile_Timer.h"
#include "ace/Time_Value.h"
#include "tao/Messaging/Messaging.h"
#include "tao/Messaging/TAO_ExtC.h"
ACE_Profile_Timer timer; //定时器
TimeBase::TimeT timeout = 6*1000*10000; //超时6秒
//获取ORB的策略对象
CORBA::Object_var objPolicy = orb->resolve_initial_references("PolicyCurrent" ACE_ENV_ARG_PARAMETER);
CORBA::PolicyCurrent_var policyCur = CORBA::PolicyCurrent::_narrow(objPolicy.in() ACE_ENV_ARG_PARAMETER);
//设置超时
CORBA::Any anyTm;
anyTm <<= timeout;
//设置ORB策略
CORBA::PolicyList policy_list(1);
policy_list.length (1);
policy_list[0] = orb->create_policy (Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE, anyTm ACE_ENV_ARG_PARAMETER);
policyCur->set_policy_overrides (policy_list, CORBA::ADD_OVERRIDE ACE_ENV_ARG_PARAMETER);
policy_list[0]->destroy(ACE_ENV_SINGLE_ARG_PARAMETER);
//启动定时器
timer.start();
this->server_ = Broadcaster::_narrow (server_object.in ());
if (CORBA::is_nil (this->server_.in ()))
{
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("Nil Server/n")),
-1);
}
timer.stop();
ACE_Profile_Timer::ACE_Elapsed_Time el;
timer.elapsed_time (el);
printf("elapse time is %d/n", el.real_time);
ACE_Profile_Timer timer; //定时器
TimeBase::TimeT timeout = 1*1000*10000; //超时6秒
//获取ORB的策略对象
CORBA::Object_var objPolicy = orb->resolve_initial_references("PolicyCurrent" ACE_ENV_ARG_PARAMETER);
CORBA::PolicyCurrent_var policyCur = CORBA::PolicyCurrent::_narrow(objPolicy.in() ACE_ENV_ARG_PARAMETER);
//设置超时
CORBA::Any anyTm;
anyTm <<= timeout;
//设置ORB策略
CORBA::PolicyList policy_list(1);
policy_list.length (1);
policy_list[0] = orb->create_policy (Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE, anyTm ACE_ENV_ARG_PARAMETER);
policyCur->set_policy_overrides (policy_list, CORBA::ADD_OVERRIDE ACE_ENV_ARG_PARAMETER);
policy_list[0]->destroy(ACE_ENV_SINGLE_ARG_PARAMETER);
try {
CORBA::Object_var obj = getObjectReference(orb);
this->server_ = Broadcaster::_narrow(obj.in ());
if (CORBA::is_nil (this->server_.in ()))
{
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("Nil Server/n")),
-1);
}
} catch (...) {
return 1;
}
- test1
- test1
- test1
- test1
- test1
- test1
- TEST1
- test1
- test1
- TEST1
- Test1
- test1
- Test1
- Test1
- Test1
- test1
- test1
- test1
- UML视图显示
- 条件编译
- linux上sap账户和组关系
- 利用Expect实现telnet自动登录并执行command
- 例句和句型:9.04
- test1
- 简述C和C++的学习历程
- YIELD,吃力
- Android 3G应用
- 今天问了ORACLE ACS们9i 和 10gV$SQL在功能上的不同之处
- Tocat 下的日志配置
- Python Socket 1
- test
- 伪随机函数的实现