<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.stomp.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'tr',
  ),
  'this' => 
  array (
    0 => 'stomp.ack.php',
    1 => 'Stomp::ack',
    2 => 'Acknowledges consumption of a message',
  ),
  'up' => 
  array (
    0 => 'class.stomp.php',
    1 => 'Stomp',
  ),
  'prev' => 
  array (
    0 => 'stomp.abort.php',
    1 => 'Stomp::abort',
  ),
  'next' => 
  array (
    0 => 'stomp.begin.php',
    1 => 'Stomp::begin',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/stomp/stomp/ack.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="stomp.ack" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Stomp::ack</h1>
  <h1 class="refname">stomp_ack</h1>
  <p class="verinfo">(PECL stomp &gt;= 0.1.0)</p><p class="refpurpose"><span class="refname">Stomp::ack</span> -- <span class="refname">stomp_ack</span> &mdash; <span class="dc-title">Acknowledges consumption of a message</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-stomp.ack-description">
  <h3 class="title">Açıklama</h3>
  <p class="simpara">Nesne yönelimli kullanım (method):</p>
   <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>Stomp::ack</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$msg</code></span>, <span class="methodparam"><span class="type"><a href="language.types.array.php" class="type array">array</a></span> <code class="parameter">$headers</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">Yordamsal kullanım:</p>
  <div class="methodsynopsis dc-description"><span class="methodname"><strong>stomp_ack</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$link</code></span>, <span class="methodparam"><span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$msg</code></span>, <span class="methodparam"><span class="type"><a href="language.types.array.php" class="type array">array</a></span> <code class="parameter">$headers</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">
   Acknowledges consumption of a message from a subscription using client acknowledgment.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-stomp.ack-parameters">
  <h3 class="title">Bağımsız Değişkenler</h3>
  <dl>
   <dt><code class="parameter">link</code></dt><dd><p class="para">Procedural style only: The stomp link identifier returned by <span class="function"><a href="stomp.construct.php" class="function">stomp_connect()</a></span>.</p></dd>
   
    <dt><code class="parameter">msg</code></dt>
    <dd>
     <span class="simpara">
      The message/messageId to be acknowledged.
     </span>
    </dd>
   
   <dt><code class="parameter">headers</code></dt><dd><p class="para">Associative array containing the additional headers (example: receipt).</p></dd>
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-stomp.ack-returnvalues">
  <h3 class="title">Dönen Değerler</h3>
  <p class="simpara">
   Başarı durumunda <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>, başarısızlık durumunda <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> döner.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-stomp.ack-examples">
  <h3 class="title">Örnekler</h3>
  <div class="example" id="example-1">
   <p><strong>Örnek 1 Nesne yönelimli kullanım</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br />$queue  </span><span style="color: #007700">= </span><span style="color: #DD0000">'/queue/foo'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$msg    </span><span style="color: #007700">= </span><span style="color: #DD0000">'bar'</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">/* connection */<br /></span><span style="color: #007700">try {<br />    </span><span style="color: #0000BB">$stomp </span><span style="color: #007700">= new </span><span style="color: #0000BB">Stomp</span><span style="color: #007700">(</span><span style="color: #DD0000">'tcp://localhost:61613'</span><span style="color: #007700">);<br />} catch(</span><span style="color: #0000BB">StompException $e</span><span style="color: #007700">) {<br />    die(</span><span style="color: #DD0000">'Connection failed: ' </span><span style="color: #007700">. </span><span style="color: #0000BB">$e</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getMessage</span><span style="color: #007700">());<br />}<br /><br /></span><span style="color: #FF8000">/* send a message to the queue 'foo' */<br /></span><span style="color: #0000BB">$stomp</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">send</span><span style="color: #007700">(</span><span style="color: #0000BB">$queue</span><span style="color: #007700">, </span><span style="color: #0000BB">$msg</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* subscribe to messages from the queue 'foo' */<br /></span><span style="color: #0000BB">$stomp</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">subscribe</span><span style="color: #007700">(</span><span style="color: #0000BB">$queue</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* read a frame */<br /></span><span style="color: #0000BB">$frame </span><span style="color: #007700">= </span><span style="color: #0000BB">$stomp</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">readFrame</span><span style="color: #007700">();<br /><br />if (</span><span style="color: #0000BB">$frame</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">body </span><span style="color: #007700">=== </span><span style="color: #0000BB">$msg</span><span style="color: #007700">) {<br />    </span><span style="color: #FF8000">/* acknowledge that the frame was received */<br />    </span><span style="color: #0000BB">$stomp</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ack</span><span style="color: #007700">(</span><span style="color: #0000BB">$frame</span><span style="color: #007700">);<br />}<br /><br /></span><span style="color: #FF8000">/* remove the subscription */<br /></span><span style="color: #0000BB">$stomp</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">unsubscribe</span><span style="color: #007700">(</span><span style="color: #0000BB">$queue</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* close connection */<br /></span><span style="color: #007700">unset(</span><span style="color: #0000BB">$stomp</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

  </div>
  <div class="example" id="example-2">
   <p><strong>Örnek 2 Yordamsal kullanım</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br />$queue  </span><span style="color: #007700">= </span><span style="color: #DD0000">'/queue/foo'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$msg    </span><span style="color: #007700">= </span><span style="color: #DD0000">'bar'</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">/* connection */<br /></span><span style="color: #0000BB">$link </span><span style="color: #007700">= </span><span style="color: #0000BB">stomp_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">'ssl://localhost:61612'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* check connection */<br /></span><span style="color: #007700">if (!</span><span style="color: #0000BB">$link</span><span style="color: #007700">) {<br />    die(</span><span style="color: #DD0000">'Connection failed: ' </span><span style="color: #007700">. </span><span style="color: #0000BB">stomp_connect_error</span><span style="color: #007700">());<br />}<br /><br /></span><span style="color: #FF8000">/* begin a transaction */<br /></span><span style="color: #0000BB">stomp_begin</span><span style="color: #007700">(</span><span style="color: #0000BB">$link</span><span style="color: #007700">, </span><span style="color: #DD0000">'t1'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* send a message to the queue 'foo' */<br /></span><span style="color: #0000BB">stomp_send</span><span style="color: #007700">(</span><span style="color: #0000BB">$link</span><span style="color: #007700">, </span><span style="color: #0000BB">$queue</span><span style="color: #007700">, </span><span style="color: #0000BB">$msg</span><span style="color: #007700">, array(</span><span style="color: #DD0000">'transaction' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'t1'</span><span style="color: #007700">));<br /><br /></span><span style="color: #FF8000">/* commit a transaction */<br /></span><span style="color: #0000BB">stomp_commit</span><span style="color: #007700">(</span><span style="color: #0000BB">$link</span><span style="color: #007700">, </span><span style="color: #DD0000">'t1'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* subscribe to messages from the queue 'foo' */<br /></span><span style="color: #0000BB">stomp_subscribe</span><span style="color: #007700">(</span><span style="color: #0000BB">$link</span><span style="color: #007700">, </span><span style="color: #0000BB">$queue</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* read a frame */<br /></span><span style="color: #0000BB">$frame </span><span style="color: #007700">= </span><span style="color: #0000BB">stomp_read_frame</span><span style="color: #007700">(</span><span style="color: #0000BB">$link</span><span style="color: #007700">);<br /><br />if (</span><span style="color: #0000BB">$frame</span><span style="color: #007700">[</span><span style="color: #DD0000">'body'</span><span style="color: #007700">] === </span><span style="color: #0000BB">$msg</span><span style="color: #007700">) {<br />    </span><span style="color: #FF8000">/* acknowledge that the frame was received */<br />    </span><span style="color: #0000BB">stomp_ack</span><span style="color: #007700">(</span><span style="color: #0000BB">$link</span><span style="color: #007700">, </span><span style="color: #0000BB">$frame</span><span style="color: #007700">[</span><span style="color: #DD0000">'headers'</span><span style="color: #007700">][</span><span style="color: #DD0000">'message-id'</span><span style="color: #007700">]);<br />}<br /><br /></span><span style="color: #FF8000">/* remove the subscription */<br /></span><span style="color: #0000BB">stomp_unsubscribe</span><span style="color: #007700">(</span><span style="color: #0000BB">$link</span><span style="color: #007700">, </span><span style="color: #0000BB">$queue</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* close connection */<br /></span><span style="color: #0000BB">stomp_close</span><span style="color: #007700">(</span><span style="color: #0000BB">$link</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

  </div>
 </div>


 <div class="refsect1 notes" id="refsect1-stomp.ack-notes">
  <h3 class="title">Notlar</h3>
  <blockquote class="note"><p><strong class="note">Bilginize</strong>: <p class="para">A transaction header may be specified, indicating that the message acknowledgment should be part of the named transaction.</p></p></blockquote>
  <div class="tip"><strong class="tip">İpucu</strong><p class="simpara">Stomp is inherently asynchronous. Synchronous communication can be implemented adding a receipt header. This will cause methods to not return anything until the server has acknowledged receipt of the message or until read timeout was reached.</p></div>
 </div>


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