mirror of
https://github.com/php/doc-es.git
synced 2026-03-25 16:02:13 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@334647 c90b9560-bf6c-de11-be94-00142212c4b1
133 lines
4.2 KiB
XML
133 lines
4.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 8b5940cadeb4f1c8492f4a7f70743a2be807cf39 Maintainer: seros Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.socket-read">
|
|
<refnamediv>
|
|
<refname>socket_read</refname>
|
|
<refpurpose>Lee un máximo de longitud de bytes desde un socket</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>socket_read</methodname>
|
|
<methodparam><type>resource</type><parameter>socket</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>length</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>type</parameter><initializer>PHP_BINARY_READ</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
La función <function>socket_read</function> lee desde un recurso
|
|
socket <parameter>socket</parameter> creado por las funciones
|
|
<function>socket_create</function> o
|
|
<function>socket_accept</function>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>socket</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Un recurso socket válido creado con <function>socket_create</function>
|
|
o <function>socket_accept</function>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>length</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
El número máximo de bytes leidos es espeicificado por el
|
|
parámetro <parameter>length</parameter>. Por lo demás se puede usar
|
|
<constant>\r</constant>, <constant>\n</constant>,
|
|
o <constant>\0</constant> para finalizar la lectura (dependiendo del parámetro
|
|
<parameter>type</parameter>, véase abajo).
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>type</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
EL parámetro opcional <parameter>type</parameter> es una constante nominada:
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
<constant>PHP_BINARY_READ</constant> (Predeterminada) - usa la función
|
|
del sistema <literal>recv()</literal>. Segura para la lectura de información binaria.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<constant>PHP_NORMAL_READ</constant> - la lectura se detiene en
|
|
<literal>\n</literal> o <literal>\r</literal>.
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
<function>socket_read</function> devuelve la información como cadena en caso de éxito,
|
|
o &false; en caso de error (incluyendo si el host remoto cerró la
|
|
conexión). El código de error real se puede recuperar
|
|
llamando a <function>socket_last_error</function>. Este código se puede
|
|
pasar a <function>socket_strerror</function> para obtener una explicación textual
|
|
del error.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
<function>socket_read</function> devuelve una cadena de longitud cero ("")
|
|
cuando no hay más información que leer.
|
|
</para>
|
|
</note>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>socket_accept</function></member>
|
|
<member><function>socket_bind</function></member>
|
|
<member><function>socket_connect</function></member>
|
|
<member><function>socket_listen</function></member>
|
|
<member><function>socket_last_error</function></member>
|
|
<member><function>socket_strerror</function></member>
|
|
<member><function>socket_write</function></member>
|
|
</simplelist>
|
|
</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
|
|
-->
|