<?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 => 'it',
  ),
  'this' => 
  array (
    0 => 'function.socket-get-option.php',
    1 => 'socket_get_option',
    2 => 'Ottiene le opzioni per un socket',
  ),
  'up' => 
  array (
    0 => 'ref.sockets.php',
    1 => 'Socket Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.socket-export-stream.php',
    1 => 'socket_export_stream',
  ),
  'next' => 
  array (
    0 => 'function.socket-getopt.php',
    1 => 'socket_getopt',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'it',
    'path' => 'reference/sockets/functions/socket-get-option.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.socket-get-option" class="refentry">
   <div class="refnamediv">
    <h1 class="refname">socket_get_option</h1>
    <p class="verinfo">(PHP 4 &gt;= 4.3.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">socket_get_option</span> &mdash; <span class="dc-title">Ottiene le opzioni per un socket</span></p>

   </div>
   <div class="refsect1 unknown-1138" id="refsect1-function.socket-get-option-unknown-1138">
    <h3 class="title">Descrizione</h3>
     <div class="methodsynopsis dc-description">
      <span class="methodname"><strong>socket_get_option</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"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$level</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$optname</code></span>): <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span></div>

     <div class="warning"><strong class="warning">Avviso</strong><p class="simpara">Questa funzione è
<em>SPERIMENTALE</em>. Ovvero, il comportamento di questa funzione,
il nome di questa funzione, in definitiva tutto ciò che è documentato qui 
può cambiare nei futuri rilasci del PHP senza preavviso. Siete avvisati, l&#039;uso di questa
funzione è a vostro rischio.</p></div>
    <p class="para">
     La funzione <span class="function"><strong>socket_get_option()</strong></span> restituisce i valori per il parametro
     indicato in <code class="parameter">optname</code> per il socket indicato
     da <code class="parameter">socket</code>. La funzione restituisce
     <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> se non riesce.
    </p>
    <p class="para">
     Il parametro  <code class="parameter">level</code> specifica a quale livello di protocollo
     risiede l&#039;opzione cercata. Ad esempio, per recuperare le informzioni su opzioni a livello di socket,
     il parametro <code class="parameter">level</code> deve essere impostato a SOL_SOCKET. Altri livelli
     tipo TCP, possono essere utilizzati specificando il numero del livello.
     I numeri dei livelli dei protocolli possono essere ottenuti tramite <span class="function"><a href="function.getprotobyname.php" class="function">getprotobyname()</a></span>.
    </p>
    <table class="doctable table">
    <caption><strong>Opzioni per i socket disponibili</strong></caption>
    
     <thead>
      <tr>
       <th>Opzione</th>
       <th>Descrizione</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>SO_DEBUG</td>
       <td>
        Riporta informazioni per il debug.
       </td>
      </tr>

      <tr>
       <td>SO_ACCEPTCONN</td>
       <td>
        Indica se il socket è abilitato in ascolto. 
       </td>
      </tr>

      <tr>
       <td>SO_BROADCAST</td>
       <td>
        Indica se sono supportate le trasmissioni dei messaggi di broadcast. 
       </td>
      </tr>

      <tr>
       <td>SO_REUSEADDR</td>
       <td>
        Riporta se gli indirizzi locali possono essere riutilizzati. 
       </td>
      </tr>

      <tr>
       <td>SO_KEEPALIVE</td>
       <td>
        Riporta se la connesisone deve essere mantenuta attiva tramite la trasmissione 
        periodica di messaggi. Se il socket connesso non risponde a questi messaggi,
        la connessione viene interrotta ed i processi che stavano scrivendo in quel socket riceveranno
        il segnale SIGPIPE.
       </td>
      </tr>

      <tr>
       <td>SO_LINGER</td>
       <td>
        Indice se il <code class="parameter">socket</code> debba ritardare il <span class="function"><a href="function.socket-close.php" class="function">socket_close()</a></span> se vi sono dati.
       </td>
      </tr>

      <tr>
       <td>SO_OOBINLINE</td>
       <td>
        Indica se il <code class="parameter">socket</code> gestisce i dati fuori-banda.
       </td>
      </tr>

      <tr>
       <td>SO_SNDBUF</td>
       <td>
        Riporta le dimensioni del buffer di trasmissione. 
       </td>
      </tr>

      <tr>
       <td>SO_RCVBUF</td>
       <td>
        Riporta le dimensioni del buffer di ricezione. 
       </td>
      </tr>

      <tr>
       <td>SO_ERROR</td>
       <td>
        Restituisce informaizoni sugli stati di errore e li ripulisce. 
       </td>
      </tr>

      <tr>
       <td>SO_TYPE</td>
       <td>
        Restituisce il tipo di<code class="parameter">socket</code>.
       </td>
      </tr>

      <tr>
       <td>SO_DONTROUTE</td>
       <td>
        Indica se i messaggi in uscita ignorano i parametri standard di routing.
       </td>
      </tr>

      <tr>
       <td>SO_RCVLOWAT</td>
       <td>
        Indica il numero minimo di byte da processare da parte del  <code class="parameter">socket</code> per le operazioni
        di input (default 1).
       </td>
      </tr>

      <tr>
       <td>SO_RCVTIMEO</td>
       <td>
        Tempo di timeout per le operazioni di input. 
       </td>
      </tr>

      <tr>
       <td>SO_SNDLOWAT</td>
       <td>
        Riporta il numero minimo di byte da processare da parte del <code class="parameter">socket</code> per le operazioni di output.
       </td>
      </tr>

      <tr>
       <td>SO_SNDTIMEO</td>
       <td>
        Indica il tempo di timeout specificando il tempo che una funzione di output
        resti bloccata in attesa di potere inviare i dati. 
       </td>
      </tr>

     </tbody>
    
    </table>

    <blockquote class="note"><p><strong class="note">Nota</strong>: 
     <p class="para">
      Nelle versioni di PHP antecedenti la 4.3.0, questa funzione 
      era chiamata <code class="literal">socket_getopt()</code>.
     </p>
    </p></blockquote>
   </div>

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