<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.sockets.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'function.socket-send.php',
    1 => 'socket_send',
    2 => 'Sends data to a connected socket',
  ),
  'up' => 
  array (
    0 => 'ref.sockets.php',
    1 => 'Socket Функції',
  ),
  'prev' => 
  array (
    0 => 'function.socket-select.php',
    1 => 'socket_select',
  ),
  'next' => 
  array (
    0 => 'function.socket-sendmsg.php',
    1 => 'socket_sendmsg',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/sockets/functions/socket-send.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.socket-send" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">socket_send</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.1.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">socket_send</span> &mdash; <span class="dc-title">Sends data to a connected socket</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.socket-send-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>socket_send</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="class.socket.php" class="type Socket">Socket</a></span> <code class="parameter">$socket</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$data</code></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">$length</code></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">$flags</code></span><br>): <span class="type"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   The function <span class="function"><strong>socket_send()</strong></span> sends
   <code class="parameter">length</code> bytes to the socket
   <code class="parameter">socket</code> from <code class="parameter">data</code>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.socket-send-parameters">
  <h3 class="title">Параметри</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">socket</code></dt>
     <dd>
      <p class="para">
       A <span class="classname"><a href="class.socket.php" class="classname">Socket</a></span> instance created with <span class="function"><a href="function.socket-create.php" class="function">socket_create()</a></span>
       or <span class="function"><a href="function.socket-accept.php" class="function">socket_accept()</a></span>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">data</code></dt>
     <dd>
      <p class="para">
       A buffer containing the data that will be sent to the remote host.
      </p>
     </dd>
    
    
     <dt><code class="parameter">length</code></dt>
     <dd>
      <p class="para">
       The number of bytes that will be sent to the remote host from 
       <code class="parameter">data</code>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">flags</code></dt>
     <dd>
      <p class="para">
       The value of <code class="parameter">flags</code> can be any combination of 
       the following flags, joined with the binary OR (<code class="literal">|</code>)
       operator.
       <table class="doctable table">
        <caption><strong>Possible values for <code class="parameter">flags</code></strong></caption>
        
         <tbody class="tbody">
          <tr>
           <td><strong><code><a href="sockets.constants.php#constant.msg-oob">MSG_OOB</a></code></strong></td>
           <td>
            Send OOB (out-of-band) data.
           </td>
          </tr>

          <tr>
           <td><strong><code><a href="sockets.constants.php#constant.msg-eor">MSG_EOR</a></code></strong></td>
           <td>
            Indicate a record mark. The sent data completes the record.
           </td>
          </tr>

          <tr>
           <td><strong><code><a href="sockets.constants.php#constant.msg-eof">MSG_EOF</a></code></strong></td>
           <td>
            Close the sender side of the socket and include an appropriate
            notification of this at the end of the sent data. The sent data
            completes the transaction.
           </td>
          </tr>

          <tr>
           <td><strong><code><a href="sockets.constants.php#constant.msg-dontroute">MSG_DONTROUTE</a></code></strong></td>
           <td>
            Bypass routing, use direct interface.
           </td>
          </tr>

         </tbody>
        
       </table>

      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.socket-send-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">
   <span class="function"><strong>socket_send()</strong></span> returns the number of bytes sent, or <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> on error. 
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.socket-send-changelog">
  <h3 class="title">Журнал змін</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Версія</th>
      <th>Опис</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
  <td>8.0.0</td>
  <td>
   Тепер <code class="parameter">socket</code> є примірником
   <span class="classname"><a href="class.socket.php" class="classname">Socket</a></span>; раніше це був <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span>.
  </td>
 </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.socket-send-seealso">
  <h3 class="title">Прогляньте також</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.socket-sendto.php" class="function" rel="rdfs-seeAlso">socket_sendto()</a> - Sends a message to a socket, whether it is connected or not</span></li>
   </ul>
  </p>
 </div>


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