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@314557 c90b9560-bf6c-de11-be94-00142212c4b1
87 lines
3.2 KiB
XML
87 lines
3.2 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-write' in en/ tree in rev 1.27 -->
|
|
<!-- EN-Revision: n/a Maintainer: darvina Status: ready -->
|
|
<!-- OLD-Revision: 1.34/EN.1.27 -->
|
|
<refentry xml:id="function.socket-write" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>socket_write</refname>
|
|
<refpurpose>Scrive su un socket.</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Descrizione</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>socket_write</methodname>
|
|
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>buffer</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>lunghezza</parameter></methodparam>
|
|
</methodsynopsis>
|
|
&warn.experimental.func;
|
|
<para>
|
|
La funzione <function>socket_write</function> scrive sul socket
|
|
<parameter>socket</parameter> i dati tratti dal campo
|
|
<parameter>buffer</parameter>.
|
|
</para>
|
|
<para>
|
|
Il parametro opzionale <parameter>lunghezza</parameter> può specificare un
|
|
numero alternativo di bytes da scrivere nel socket. Se questa dimensione è maggiore
|
|
della lunghezza di buffer, questa viene, in modo silenzioso, ridotta alla
|
|
lunghezza di buffer.
|
|
</para>
|
|
<para>
|
|
La funzione restituisce il numero di bytes scritti con successo nel socket, oppure
|
|
&false; se si verifica un errore. Il codice di errore può essere rilevato con
|
|
<function>socket_last_error</function>. Passando questo codice alla funzione
|
|
<function>socket_strerror</function> si ottiene una spiegazione
|
|
dell'errore.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
<function>socket_write</function> non scrive necessariamente tutti i byte
|
|
da un dato buffer. E' ammesso che, in base alle dimensioni dei buffer della rete
|
|
ecc., soltanto un certo ammontare di dati, anche un solo byte, sia scritto
|
|
nel socket, nonostante il buffer sia di dimensioni maggiori. Si deve prestare attenzione
|
|
a ciò per evitare di non inviare il resto dei dati.
|
|
</para>
|
|
</note>
|
|
<note>
|
|
<para>
|
|
E' regolare per la funzione <function>socket_write</function> restituire
|
|
zero, ciò significa che non è stato scritto alcun byte. Si utilizzi
|
|
l'operatore <literal>===</literal> per testare il caso di &false;
|
|
nelle situazioni di errore.
|
|
</para>
|
|
</note>
|
|
<para>
|
|
Vedere anche
|
|
<function>socket_accept</function>,
|
|
<function>socket_bind</function>,
|
|
<function>socket_connect</function>,
|
|
<function>socket_listen</function>,
|
|
<function>socket_read</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
|
|
-->
|