Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 4326

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Send a message to a message queue</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.msg-remove-queue.html">msg_remove_queue</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.msg-set-queue.html">msg_set_queue</a></div>
 <div class="up"><a href="ref.sem.html">Semaphore Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.msg-send" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">msg_send</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.3.0, PHP 5)</p><p class="refpurpose"><span class="refname">msg_send</span> &mdash; <span class="dc-title">Send a message to a message queue</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.msg-send-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>msg_send</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$queue</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$msgtype</code></span>
   , <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$message</code></span>
   [, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$serialize</code><span class="initializer"> = true</span></span>
   [, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$blocking</code><span class="initializer"> = true</span></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter reference">&$errorcode</code></span>
  ]]] )</div>

  <p class="para rdfs-comment">
    <span class="function"><strong>msg_send()</strong></span> sends a <em><code class="parameter">message</code></em> of type
   <em><code class="parameter">msgtype</code></em> (which MUST be greater than 0) to
   the message queue specified by <em><code class="parameter">queue</code></em>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.msg-send-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    <dt>

     <span class="term"><em><code class="parameter">queue</code></em></span>
     <dd>

      <p class="para">
      </p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">msgtype</code></em></span>
     <dd>

      <p class="para">
      </p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">message</code></em></span>
     <dd>

      <p class="para">
      </p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">serialize</code></em></span>
     <dd>

      <p class="para">
       The optional <em><code class="parameter">serialize</code></em> controls how the
       <em><code class="parameter">message</code></em> is sent.  <em><code class="parameter">serialize</code></em>
       defaults to <strong><code>TRUE</code></strong> which means that the <em><code class="parameter">message</code></em> is
       serialized using the same mechanism as the session module before being
       sent to the queue.  This allows complex arrays and objects to be sent to
       other PHP scripts, or if you are using the WDDX serializer, to any WDDX
       compatible client.
      </p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">blocking</code></em></span>
     <dd>

      <p class="para">
       If the message is too large to fit in the queue, your script will wait
       until another process reads messages from the queue and frees enough
       space for your message to be sent.
       This is called blocking; you can prevent blocking by setting the
       optional <em><code class="parameter">blocking</code></em> parameter to <strong><code>FALSE</code></strong>, in which
       case  <span class="function"><strong>msg_send()</strong></span> will immediately return <strong><code>FALSE</code></strong> if the
       message is too big for the queue, and set the optional
       <em><code class="parameter">errorcode</code></em> to <strong><code>MSG_EAGAIN</code></strong>,
       indicating that you should try to send your message again a little
       later on.
      </p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">errorcode</code></em></span>
     <dd>

      <p class="para">
      </p>
     </dd>

    </dt>

   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.msg-send-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns <strong><code>TRUE</code></strong> on success or <strong><code>FALSE</code></strong> on failure.
  </p>
  <p class="para">
   Upon successful completion the message queue data structure is updated as
   follows: <em><code class="parameter">msg_lspid</code></em> is set to the process-ID of the
   calling process, <em><code class="parameter">msg_qnum</code></em> is incremented by 1 and
   <em><code class="parameter">msg_stime</code></em> is set to the current time.
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.msg-send-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"> <span class="function"><a href="function.msg-remove-queue.html" class="function" rel="rdfs-seeAlso">msg_remove_queue()</a> - Destroy a message queue</span></li>
    <li class="member"> <span class="function"><a href="function.msg-receive.html" class="function" rel="rdfs-seeAlso">msg_receive()</a> - Receive a message from a message queue</span></li>
    <li class="member"> <span class="function"><a href="function.msg-stat-queue.html" class="function" rel="rdfs-seeAlso">msg_stat_queue()</a> - Returns information from the message queue data structure</span></li>
    <li class="member"> <span class="function"><a href="function.msg-set-queue.html" class="function" rel="rdfs-seeAlso">msg_set_queue()</a> - Set information in the message queue data structure</span></li>
   </ul>
  </p>
 </div>
  

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.msg-remove-queue.html">msg_remove_queue</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.msg-set-queue.html">msg_set_queue</a></div>
 <div class="up"><a href="ref.sem.html">Semaphore Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>