-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathsocket-write.xml
86 lines (85 loc) · 3.23 KB
/
socket-write.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?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
-->