timeout_client.h

来自「这是广泛使用的通信开源项目,对于大容量,高并发的通讯要求完全能够胜任,他广泛可用」· C头文件 代码 · 共 82 行

H
82
字号
// timeout_client.h,v 1.6 2003/05/04 23:16:31 parsons Exp

// ============================================================================
//
// = LIBRARY
//    TAO/tests/AMI_Timeouts
//
// = FILENAME
//    timeout_client.h
//
// = DESCRIPTION
//    Tests timeouts with AMI.
//
// = AUTHOR
//    Michael Kircher <Michael.Kircher@mchp.siemens.de>
//
// ============================================================================


#include "ace/Task.h"

#include "timeout_i.h"

class TimeoutClient
: public ACE_Task_Base
{
public:
  TimeoutClient (CORBA::ORB_ptr orb,
                 TimeoutObj_ptr timeoutObject,
                 AMI_TimeoutObjHandler_ptr replyHandlerObject,
                 TimeoutHandler_i *timeoutHandler_i,
                 unsigned long timeToWait);

  ~TimeoutClient ();


private:
  // Initialize the context of this class.
  int initialize ();

  // Run in a separate thread.
  virtual int svc (void );

  // Wrapps complex invocations logic.
  void send (CORBA::Boolean async,
             unsigned long local_timeout,
             unsigned long remote_sleep);

  // Test if the synchronous timeouts still work.
  int synch_test ();

  // Test the accuracy of the timeouts.
  int accuracy_test ();

  // Test if the timeout functionaltiy disturbs non-timeout invocations
  int none_test ();

private:
  CORBA::ORB_var orb_;

  // A CORBA object reference to the target object.
  TimeoutObj_var timeoutObject_;

  // A CORBA object reference to the reply handler
  AMI_TimeoutObjHandler_var replyHandlerObject_;

  // A pointer to the actual C++ reply handler implementation
  TimeoutHandler_i *timeoutHandler_i_;

  // Remember the policy manager.
  CORBA::PolicyManager_var policy_manager_;

  // Count test local exceptions
  unsigned short local_reply_excep_counter_;

  const CORBA::Boolean INVOKE_SYNCH;

  const CORBA::Boolean INVOKE_ASYNCH;

  unsigned int timeToWait_;
};

⌨️ 快捷键说明

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