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

📄 object1_i.cpp

📁 这是广泛使用的通信开源项目,对于大容量,高并发的通讯要求完全能够胜任,他广泛可用于网络游戏医学图像网关的高qos要求.更详细的内容可阅读相应的材料
💻 CPP
字号:
/* -*- C++ -*- */

//=============================================================================
/**
 *  @file    Object1_i.cpp
 *
 *  Object1_i.cpp,v 1.6 2003/11/04 08:12:59 dhinton Exp
 *
 *  @author Matt Murphy <murphym@cs.uri.edu>
 */
//=============================================================================

#include "Object1_i.h"
#include "ace/ACE.h"
#include "ace/OS_NS_stdio.h"
#include "ace/OS_NS_string.h"
//#include "tao/RTCORBA/RTCORBA.h"
////##include "ace/Task.h"
//
//#if !defined (ACE_LACKS_PRAGMA_ONCE)
//# pragma once
//#endif /* ACE_LACKS_PRAGMA_ONCE */
//
////#include "ace/CORBA_macros.h"
////#include "tao/RTCORBA/Priority_Mapping_Manager.h"
////#include "tao/corba.h"
////#include "tao/ORB_Core.h"
//

Object1_impl::Object1_impl()
  throw (CORBA::SystemException)
{
}


Object1_impl::~Object1_impl()
  throw (CORBA::SystemException)
{
}


void Object1_impl::method1(const char* activity,
    CORBA::Long seconds,
    char* &output
    ACE_ENV_ARG_DECL_NOT_USED)
  throw (testSched::testSchedException)
{
  const int scale_factor = 2000;
  int work;
  const int time_size = 35;
  ACE_TCHAR date_and_time[time_size];
  char buf[128];
  char buf2[128];

  ACE_OS::sprintf(buf,
                  "%s\t%s\tBeginning work on the server\n",
                   ACE::timestamp(date_and_time, time_size),
                   activity);
  ACE_DEBUG((LM_DEBUG,"%s",buf));



  if (ACE_OS::strcmp(activity,"Client1") == 0)
    {
       ACE_OS::sleep(5);
    }

  /// Simulate some work
  static CORBA::ULong prime_number = 9619;
  work = scale_factor * seconds;
  for (; work != 0; work--)
    {
      ACE::is_prime (prime_number, 2, prime_number / 2);
    }

  ACE_OS::sprintf(buf2,
                  "%s\t%s\tFinished work on the server\n",
                  ACE::timestamp(date_and_time, time_size),
                  activity);
  ACE_DEBUG((LM_DEBUG,"%s",buf2));
  ACE_OS::strcat(buf,buf2);
  output = ACE_OS::strdup(buf);

}

⌨️ 快捷键说明

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