<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.eventbufferevent.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'eventbufferevent.construct.php',
    1 => 'EventBufferEvent::__construct',
    2 => 'Constructs EventBufferEvent object',
  ),
  'up' => 
  array (
    0 => 'class.eventbufferevent.php',
    1 => 'EventBufferEvent',
  ),
  'prev' => 
  array (
    0 => 'eventbufferevent.connecthost.php',
    1 => 'EventBufferEvent::connectHost',
  ),
  'next' => 
  array (
    0 => 'eventbufferevent.createpair.php',
    1 => 'EventBufferEvent::createPair',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/event/eventbufferevent/construct.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="eventbufferevent.construct" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">EventBufferEvent::__construct</h1>
  <p class="verinfo">(PECL event &gt;= 1.2.6-beta)</p><p class="refpurpose"><span class="refname">EventBufferEvent::__construct</span> &mdash; <span class="dc-title">Constructs EventBufferEvent object</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-eventbufferevent.construct-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="methodname"><strong>EventBufferEvent::__construct</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam">
    
    <span class="type"><a href="class.eventbase.php" class="type EventBase">EventBase</a></span> <code class="parameter">$base</code>
   </span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam">
    
    <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$socket</code>
    <span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span>
   </span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam">
    
    <span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$options</code>
    <span class="initializer"> = 0</span>
   </span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam">
    
    <span class="type"><a href="language.types.callable.php" class="type callable">callable</a></span> <code class="parameter">$readcb</code>
    <span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span>
   </span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam">
    
    <span class="type"><a href="language.types.callable.php" class="type callable">callable</a></span> <code class="parameter">$writecb</code>
    <span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span>
   </span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam">
    
    <span class="type"><a href="language.types.callable.php" class="type callable">callable</a></span> <code class="parameter">$eventcb</code>
    <span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span>
   </span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam">
    
    <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$arg</code>
    <span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span>
   </span><br>)</div>

  <p class="para rdfs-comment">
   Create a buffer event on a socket, stream or a file descriptor. Passing
   <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> to
   <code class="parameter">socket</code>
   means that the socket should be created later, e.g. by means of
   <span class="methodname"><a href="eventbufferevent.connect.php" class="methodname">EventBufferEvent::connect()</a></span>.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-eventbufferevent.construct-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt>
     <code class="parameter">base</code>
    </dt>
    <dd>
     <p class="para">
      Event base that should be associated with the new buffer event.
     </p>
    </dd>
   
   
    <dt>
     <code class="parameter">socket</code>
    </dt>
    <dd>
     <p class="para">
      May be created as a stream(not necessarily by means of
      <code class="literal">sockets</code>
      extension)
     </p>
    </dd>
   
   
    <dt>
     <code class="parameter">options</code>
    </dt>
    <dd>
     <p class="para">
      One of
      <a href="class.eventbufferevent.php#eventbufferevent.constants" class="link">EventBufferEvent::OPT_*
     constants</a>,
      or
      <code class="literal">0</code>.
     </p>
    </dd>
   
   
    <dt>
     <code class="parameter">readcb</code>
    </dt>
    <dd>
     <p class="para">
      Read event callback. See
      <a href="eventbufferevent.about.callbacks.php" class="link">About buffer event
     callbacks</a>.
     </p>
    </dd>
   
   
    <dt>
     <code class="parameter">writecb</code>
    </dt>
    <dd>
     <p class="para">
      Write event callback. See
      <a href="eventbufferevent.about.callbacks.php" class="link">About buffer event
     callbacks</a>.
     </p>
    </dd>
   
   
    <dt>
     <code class="parameter">eventcb</code>
    </dt>
    <dd>
     <p class="para">
      Status-change event callback. See
      <a href="eventbufferevent.about.callbacks.php" class="link">About buffer event
     callbacks</a>.
     </p>
    </dd>
   
   
    <dt>
     <code class="parameter">arg</code>
    </dt>
    <dd>
     <p class="para">
      A variable that will be passed to all the callbacks.
     </p>
    </dd>
   
  </dl>
 </div>

 <div class="refsect1 seealso" id="refsect1-eventbufferevent.construct-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li>
    <span class="methodname"><a href="eventbufferevent.sslfilter.php" class="methodname" rel="rdfs-seeAlso">EventBufferEvent::sslFilter()</a> - Create a new SSL buffer event to send its data over another buffer event</span>
   </li>
   <li>
    <span class="methodname"><a href="eventbufferevent.sslsocket.php" class="methodname" rel="rdfs-seeAlso">EventBufferEvent::sslSocket()</a> - Creates a new SSL buffer event to send its data over an SSL on a socket</span>
   </li>
  </ul>
 </div>

</div><?php manual_footer($setup); ?>