《代码阅读》光盘文件1


《代码阅读》光盘文件 放到CSDN资源做个备份 顺便分享给有需要的童鞋们
资源截图
代码片段和文件信息
// Acceptor.cppv 4.65 2001/09/06 17:25:32 othman Exp

#ifndef ACE_ACCEPTOR_C
#define ACE_ACCEPTOR_C

#include “ace/ACE.h“

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include “ace/Acceptor.h“
#include “ace/Handle_Set.h“
#include “ace/WFMO_Reactor.h“

ACE_RCSID(ace Acceptor “Acceptor.cppv 4.65 2001/09/06 17:25:32 othman Exp“)

ACE_ALLOC_HOOK_DEFINE(ACE_Acceptor)

template  void
ACE_Acceptor::dump (void) const
{
  ACE_TRACE (“ACE_Acceptor::dump“);

  ACE_DEBUG ((LM_DEBUG ACE_BEGIN_DUMP this));
  this->peer_acceptor_.dump ();
  ACE_DEBUG ((LM_DEBUG ACE_END_DUMP));
}

template 
ACE_Acceptor::operator ACE_PEER_ACCEPTOR & () const
{
  ACE_TRACE (“ACE_Acceptor::operator ACE_PEER_ACCEPTOR &“);
  return (ACE_PEER_ACCEPTOR &) this->peer_acceptor_;
}

template  ACE_PEER_ACCEPTOR &
ACE_Acceptor::acceptor (void) const
{
  ACE_TRACE (“ACE_Acceptor::acceptor“);
  return ACE_const_cast (ACE_PEER_ACCEPTOR & this->peer_acceptor_);
}

// Returns ACE_HANDLE of the underlying Acceptor_Strategy.

template  ACE_HANDLE
ACE_Acceptor::get_handle (void) const
{
  ACE_TRACE (“ACE_Acceptor::get_handle“);
  return this->peer_acceptor_.get_handle ();
}

// Initialize the appropriate strategies for creation passive
// connection acceptance and concurrency and then register 
// with the Reactor and listen for connection requests at the
// designated .

template  int
ACE_Acceptor::open
  (const ACE_PEER_ACCEPTOR_ADDR &local_addr
   ACE_Reactor *reactor
   int flags
   int use_select
   int reuse_addr)
{
  ACE_TRACE (“ACE_Acceptor::open“);
  this->flags_ = flags;
  this->use_select_ = use_select;
  this->reuse_addr_ = reuse_addr;
  this->peer_acceptor_addr_ = local_addr;

  // Must supply a valid Reactor to Acceptor::open()...

  if (reactor == 0)
    {
      errno = EINVAL;
      return -1;
    }

  if (this->peer_acceptor_.open (local_addr reuse_addr) == -1)
    return -1;

  // Set the peer acceptor‘s handle into non-blocking mode.  This is a
  // safe-guard against the race condition that can otherwise occur
  // between the time when 

评论列表(条)