Skip to content

Commit 03a1e86

Browse files
committed
Fix gh-89 add more info about socket.sysread
1 parent 94462d3 commit 03a1e86

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

sphinx/reference/reference_lua/socket.rst

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ the function invocations will look like ``sock:function_name(...)``.
272272
Reading goes on until ``limit`` bytes have been read, or a delimiter
273273
has been read, or a timeout has expired.
274274

275-
:param integer limit: maximum number of bytes to read for
275+
:param integer limit: maximum number of bytes to read, for
276276
example 50 means "stop after 50 bytes"
277277
:param string delimiter: separator for example
278278
'?' means "stop after a question mark"
@@ -289,8 +289,17 @@ the function invocations will look like ``sock:function_name(...)``.
289289

290290
.. method:: sysread(size)
291291

292-
Return all available data from the socket buffer if non-blocking.
293-
Rarely used. For details see `this description`_.
292+
Return data from the socket buffer if non-blocking.
293+
In case the socket is blocking, ``sysread()`` can block the calling process.
294+
Rarely used. For details, see also
295+
`this description <https://github.com/tarantool/tarantool/wiki/sockets%201.6>`_.
296+
297+
:param integer size: maximum number of bytes to read, for
298+
example 50 means "stop after 50 bytes"
299+
300+
:return: an empty string if there is nothing more to read, or a nil
301+
value if error, or a string up to ``size`` bytes long.
302+
:rtype: string
294303

295304
.. _socket-bind:
296305

@@ -540,10 +549,8 @@ the function invocations will look like ``sock:function_name(...)``.
540549

541550
Example: ``socket.iowait(sock:fd(), 'r', 1.11)``
542551

543-
.. _this description: https://github.com/tarantool/tarantool/wiki/sockets%201.6
544-
545552
=================================================
546-
Example
553+
Examples
547554
=================================================
548555

549556
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)