<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.evwatcher.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ja',
  ),
  'this' => 
  array (
    0 => 'evwatcher.keepalive.php',
    1 => 'EvWatcher::keepalive',
    2 => 'Configures whether to keep the loop from returning',
  ),
  'up' => 
  array (
    0 => 'class.evwatcher.php',
    1 => 'EvWatcher',
  ),
  'prev' => 
  array (
    0 => 'evwatcher.invoke.php',
    1 => 'EvWatcher::invoke',
  ),
  'next' => 
  array (
    0 => 'evwatcher.setcallback.php',
    1 => 'EvWatcher::setCallback',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/ev/evwatcher/keepalive.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="evwatcher.keepalive" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">EvWatcher::keepalive</h1>
  <p class="verinfo">(PECL ev &gt;= 0.2.0)</p><p class="refpurpose"><span class="refname">EvWatcher::keepalive</span> &mdash; <span class="dc-title">Configures whether to keep the loop from returning</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-evwatcher.keepalive-description">
  <h3 class="title">説明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="methodname"><strong>EvWatcher::keepalive</strong></span>(<span class="methodparam">
    
    <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> <code class="parameter">$value</code>
   <span class="initializer"> = ?</span></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="simpara">
   Configures whether to keep the loop from returning. With keepalive
   <code class="parameter">value</code>
   set to <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> the watcher won&#039;t keep
   <span class="methodname"><a href="ev.run.php" class="methodname">Ev::run()</a></span>
   /
   <span class="methodname"><a href="evloop.run.php" class="methodname">EvLoop::run()</a></span>
   from returning even though the watcher is active.
  </p>
  <p class="simpara">
   Watchers have keepalive
   <code class="parameter">value</code>
   <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> by default.
  </p>
  <p class="simpara">
   Clearing keepalive status is useful when returning from
   <span class="methodname"><a href="ev.run.php" class="methodname">Ev::run()</a></span>
   /
   <span class="methodname"><a href="evloop.run.php" class="methodname">EvLoop::run()</a></span>
   just because of the watcher is undesirable. It could be a long running UDP
   socket watcher or so.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-evwatcher.keepalive-parameters">
  <h3 class="title">パラメータ</h3>
  <dl>
   
    <dt>
     <code class="parameter">value</code>
    </dt>
    <dd>
     <span class="simpara">
      With keepalive
      <code class="parameter">value</code>
      set to <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> the watcher won&#039;t keep
      <span class="methodname"><a href="ev.run.php" class="methodname">Ev::run()</a></span>
      /
      <span class="methodname"><a href="evloop.run.php" class="methodname">EvLoop::run()</a></span>
      from returning even though the watcher is active.
     </span>
    </dd>
   
  </dl>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-evwatcher.keepalive-returnvalues">
  <h3 class="title">戻り値</h3>
  <p class="simpara">
   Returns the previous state.
  </p>
 </div>

 <div class="refsect1 examples" id="refsect1-evwatcher.keepalive-examples">
  <h3 class="title">例</h3>
  <div class="example" id="example-1">
   <p><strong>例1 Register an I/O watcher for some UDP socket but do not keep the
   event loop from running just because of that watcher.</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$udp_socket </span><span style="color: #007700">= ...<br /></span><span style="color: #0000BB">$udp_watcher </span><span style="color: #007700">= new </span><span style="color: #0000BB">EvIo</span><span style="color: #007700">(</span><span style="color: #0000BB">$udp_socket</span><span style="color: #007700">, </span><span style="color: #0000BB">Ev</span><span style="color: #007700">::</span><span style="color: #0000BB">READ</span><span style="color: #007700">, function () { </span><span style="color: #FF8000">/* ... */ </span><span style="color: #007700">});<br /></span><span style="color: #0000BB">$udp_watcher</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">keepalive</span><span style="color: #007700">(</span><span style="color: #0000BB">FALSE</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

  </div>
 </div>

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