mirror of
https://github.com/php/doc-it.git
synced 2026-03-24 15:42:46 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/it/trunk@327388 c90b9560-bf6c-de11-be94-00142212c4b1
78 lines
3.0 KiB
XML
78 lines
3.0 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!-- splitted from ./it/functions/sockets.xml, last change in rev 1.4 -->
|
|
<!-- last change to 'socket-accept' in en/ tree in rev 1.1 -->
|
|
<!-- EN-Revision: n/a Maintainer: darvina Status: ready -->
|
|
<!-- OLD-Revision: 1.34/EN.1.1 -->
|
|
<refentry xml:id="function.socket-accept" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>socket_accept</refname>
|
|
<refpurpose>Accetta una connessione su un socket</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Descrizione</title>
|
|
<methodsynopsis>
|
|
<type>resource</type><methodname>socket_accept</methodname>
|
|
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
|
</methodsynopsis>
|
|
&warn.experimental.func;
|
|
<para>
|
|
Dopo la creazione del socket <parameter>socket</parameter> con
|
|
<function>socket_create</function>, l'assegnazione di un nome con
|
|
<function>socket_bind</function>, e averlo messo in attesa di connessione
|
|
con <function>socket_listen</function>, con questa funzione si inizia ad accettare
|
|
le richieste di connessione su quel socket. Una volta avuta una
|
|
connessione, la funzione restituisce un nuovo socket che può essere
|
|
usato per la comunicazione. Se vi sono diverse richieste di connessioni pendenti
|
|
verrà utilizzata la prima. Viceversa se non vi sono richieste in attesa,
|
|
la funzione <function>socket_accept</function> si blocca in
|
|
attesa di una richiesta. Se il <parameter>socket</parameter> è stato
|
|
configurato "non-blocking" con
|
|
<function>socket_set_blocking</function> o con
|
|
<function>socket_set_nonblock</function>, la funzione restituirà &false;.
|
|
</para>
|
|
<para>
|
|
La risorsa socket restituita da
|
|
<function>socket_accept</function> non può essere utilizzata per acquisire
|
|
nuove connesioni. Per questo scopo occorre
|
|
continuare ad usare il socket originale, indicato in <parameter>socket</parameter>,
|
|
che rimane aperto.
|
|
</para>
|
|
<para>
|
|
La funzione restistuisce una risorsa di tipo socket se ha successo, oppure &false; se si verifica un
|
|
errore. Il codice di errore può essere recuperato chiamando
|
|
la funzione <function>socket_last_error</function>. Questo codice può
|
|
essere passato a <function>socket_strerror</function> per ottenere una descrizione
|
|
dell'errore.
|
|
</para>
|
|
<para>
|
|
Vedere anche
|
|
<function>socket_bind</function>,
|
|
<function>socket_connect</function>,
|
|
<function>socket_listen</function>,
|
|
<function>socket_create</function> e
|
|
<function>socket_strerror</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|