<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.stream.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'function.stream-socket-accept.php',
    1 => 'stream_socket_accept',
    2 => 'Accept a connection on a socket created by stream_socket_server',
  ),
  'up' => 
  array (
    0 => 'ref.stream.php',
    1 => 'Stream Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.stream-set-write-buffer.php',
    1 => 'stream_set_write_buffer',
  ),
  'next' => 
  array (
    0 => 'function.stream-socket-client.php',
    1 => 'stream_socket_client',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/stream/functions/stream-socket-accept.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.stream-socket-accept" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">stream_socket_accept</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">stream_socket_accept</span> &mdash; <span class="dc-title">Accept a connection on a socket created by <span class="function"><a href="function.stream-socket-server.php" class="function">stream_socket_server()</a></span></span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.stream-socket-accept-description">
  <h3 class="title">Descrizione</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>stream_socket_accept</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$socket</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.float.php" class="type float">float</a></span></span> <code class="parameter">$timeout</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter reference">&$peer_name</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Accept a connection on a socket previously created by
   <span class="function"><a href="function.stream-socket-server.php" class="function">stream_socket_server()</a></span>.
  </p>
 </div>

 
 <div class="refsect1 parameters" id="refsect1-function.stream-socket-accept-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">socket</code></dt>
     <dd>
      <p class="para">
       The server socket to accept a connection from.
      </p>
     </dd>
    
    
     <dt><code class="parameter">timeout</code></dt>
     <dd>
      <p class="para">
       Override the default socket accept timeout. Time should be given in
       seconds. By default, <a href="filesystem.configuration.php#ini.default-socket-timeout" class="link">default_socket_timeout</a>
       is used.
      </p>
     </dd>
    
    
     <dt><code class="parameter">peer_name</code></dt>
     <dd>
      <p class="para">
       Will be set to the name (address) of the client which connected, if
       included and available from the selected transport.
      </p>
      <blockquote class="note"><p><strong class="note">Nota</strong>: 
       <p class="para">
        Can also be determined later using
        <span class="function"><a href="function.stream-socket-get-name.php" class="function">stream_socket_get_name()</a></span>.
       </p>
      </p></blockquote>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.stream-socket-accept-returnvalues">
  <h3 class="title">Valori restituiti</h3>
  <p class="para">
   Returns a stream to the accepted socket connection o <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> in caso di fallimento.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.stream-socket-accept-changelog">
  <h3 class="title">Log delle modifiche</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Versione</th>
      <th>Descrizione</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>
       <code class="parameter">timeout</code> is now nullable.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 notes" id="refsect1-function.stream-socket-accept-notes">
  <h3 class="title">Note</h3>
  <div class="warning"><strong class="warning">Avviso</strong>
   <p class="para">
    This function should not be used with UDP server sockets. Instead, use
    <span class="function"><a href="function.stream-socket-recvfrom.php" class="function">stream_socket_recvfrom()</a></span> and
    <span class="function"><a href="function.stream-socket-sendto.php" class="function">stream_socket_sendto()</a></span>.
   </p>
 </div>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-function.stream-socket-accept-seealso">
  <h3 class="title">Vedere anche:</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.stream-socket-server.php" class="function" rel="rdfs-seeAlso">stream_socket_server()</a> - Create an Internet or Unix domain server socket</span></li>
    <li><span class="function"><a href="function.stream-socket-get-name.php" class="function" rel="rdfs-seeAlso">stream_socket_get_name()</a> - Retrieve the name of the local or remote sockets</span></li>
    <li><span class="function"><a href="function.stream-set-blocking.php" class="function" rel="rdfs-seeAlso">stream_set_blocking()</a> - Set blocking/non-blocking mode on a stream</span></li>
    <li><span class="function"><a href="function.stream-set-timeout.php" class="function" rel="rdfs-seeAlso">stream_set_timeout()</a> - Set timeout period on a stream</span></li>
    <li><span class="function"><a href="function.fgets.php" class="function" rel="rdfs-seeAlso">fgets()</a> - Prende una riga da un puntatore a file</span></li>
    <li><span class="function"><a href="function.fgetss.php" class="function" rel="rdfs-seeAlso">fgetss()</a> - Prende una riga da un puntatore a file ed elimina i tag HTML</span></li>
    <li><span class="function"><a href="function.fwrite.php" class="function" rel="rdfs-seeAlso">fwrite()</a> - Scrittura su file binary-safe</span></li>
    <li><span class="function"><a href="function.fclose.php" class="function" rel="rdfs-seeAlso">fclose()</a> - Chiude un puntatore a file aperto</span></li>
    <li><span class="function"><a href="function.feof.php" class="function" rel="rdfs-seeAlso">feof()</a> - Verifica se &egrave; stata raggiunta la fine del file su un puntatore a file</span></li>
    <li><a href="ref.curl.php" class="xref">cURL Funzioni</a></li>
   </ul>
  </p>
 </div>


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