测试一下用Live Writer发日志到student.csdn
2009-06-12 10:25
274 查看
下面是代码测试
下面是图片测试
#include "MessengerC.h" #include <iostream> #include "tao/Messaging/Messaging.h" #include "tao/Messaging/TAO_ExtC.h" #include "ace/Profile_Timer.h" ACE_Profile_Timer timer; //?¨ê±?÷ TimeBase::TimeT timeout = 6*1000*10000; //3?ê±?? int ACE_TMAIN (int argc, ACE_TCHAR* argv[]) { try { // Initialize the ORB. CORBA::ORB_var orb = CORBA::ORB_init( argc, argv ); // Read and destringify the Messenger object/'s IOR. CORBA::Object_var obj = orb->string_to_object( "file://Messenger.ior" ); if( CORBA::is_nil( obj.in() ) ) { std::cerr << "Could not get Messenger IOR." << std::endl; return 1; } //??è?ORBμ?2??????ó CORBA::Object_var object = orb->resolve_initial_references( "PolicyCurrent"); CORBA::PolicyCurrent_var policy_current = CORBA::PolicyCurrent::_narrow(object.in()); //éè??3?ê±2?êy CORBA::Any anyTm; anyTm <<=timeout; //éè??ORB2??? CORBA::PolicyList policy_list(1); policy_list.length(1); policy_list[0] = orb->create_policy(Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE,anyTm); policy_current->set_policy_overrides(policy_list,CORBA::ADD_OVERRIDE); policy_list[0]->destroy(); timer.start(); try { // Narrow the IOR to a Messenger object reference. Messenger_var messenger = Messenger::_narrow( obj.in() ); if( CORBA::is_nil( messenger.in() ) ) { std::cerr << "IOR was not a Messenger object reference." << std::endl; return 1; } // Send a message the the Messenger object. CORBA::String_var msg = CORBA::string_dup( "Hello!" ); messenger->send_message( "TAO User", "TAO Test", msg.inout() ); // Print the Messenger/'s reply. std::cout << "Reply: " << msg.in() << std::endl; } catch (...) { timer.stop(); ACE_Profile_Timer::ACE_Elapsed_Time el; timer.elapsed_time (el); printf("elapse time is %d//n", el.real_time); } return 0; } catch(const CORBA::Exception& ex) { std::cerr << "CORBA exception: " << ex << std::endl; } return 1; }
下面是图片测试
相关文章推荐
- 测试一下Windows Live Writer发布日志
- csdn windows live writer 离线日志测试
- 测试一下用Live Writer 写 csdn 的 Blog
- 测试一下 livewriter
- 用window live writer测试csdn的blog
- csdn windows live writer 日志发布地址
- 测试live writer客户端写日志
- 转载:CSDN、cnblogs使用Windows Live Writer客户端发布日志时相关配置
- csdn windows live writer 发布日志
- 转载:CSDN、cnblogs使用Windows Live Writer客户端发布日志时相关配置
- 测试一下window live writer
- [测试]学会使用Windows Live Writer写日志
- CSDN、CNBLOGS使用Windows Live Writer客户端发布日志时相关配置
- 测试并转载 Windows Live Writer 操作CSDN博客
- CSDN、cnblogs使用Windows Live Writer客户端发布日志时相关配置
- 能用Windows Live Writer为CSDN的Blog写日志吗?
- 使用Windows Live Writer写日志,自己测试的:)
- 测试一下..在 Windows Live Writer 发布日记.
- [测试]学会使用Windows Live Writer写日志
- 转载:CSDN、cnblogs使用Windows Live Writer客户端发布日志时相关配置