aboutsummaryrefslogtreecommitdiff
path: root/docs/ltn12.html
diff options
context:
space:
mode:
authorThijs Schreijer <thijs@thijsschreijer.nl>2026-09-01 10:00:21 +0200
committerThijs Schreijer <thijs@thijsschreijer.nl>2026-09-01 10:48:40 +0200
commit70f7800986812ad0d1a5dd6f280f66fd2bf1dd12 (patch)
tree36051874b3ce036307d4bb69b3c4058458b6255d /docs/ltn12.html
parentfa9b35a0cf11bc856cbd8bffbef5ad6fb3e62a93 (diff)
downloadluasocket-docs/pre-release-audit.tar.gz
luasocket-docs/pre-release-audit.tar.bz2
luasocket-docs/pre-release-audit.zip
docs: document socket.unix and socket.serial, fix stale/missing API referencesdocs/pre-release-audit
Pre-release documentation audit against master. Adds the two fully undocumented modules and closes gaps found by diffing every docs/*.html page against its corresponding source: - New docs/unix.html and docs/serial.html (socket.unix stream/dgram and socket.serial were never documented), linked from index.html, introduction.html, socket.html and reference.html. serial.html notes the current lack of a baud/parity/flow-control API and includes an os.execute+stty workaround example. Both note Windows is unsupported. - socket.html: document headers.setcanonic, point to unix/serial modules. - tcp.html: document getfamily, setpeername/setsockname aliases. - udp.html: document getfamily, getfd/setfd, dirty; document the ipv6-multicast-hops/ipv6-unicast-hops aliasing as current (known-buggy) behavior rather than the originally intended semantics. - http.html: correct redirect text (301/302/303/307/308, was 301/302 only); document MAXHEADERLINE/MAXHEADERSIZE. - dns.html: document getnameinfo. - ltn12.html: document source.rewind and BLOCKSIZE. - installation.html: fix stale "LuaSocket 3.0" sample output to 3.1.0. - reference.html: index every anchor added above plus new Unix/Serial blocks.
Diffstat (limited to '')
-rw-r--r--docs/ltn12.html38
1 files changed, 38 insertions, 0 deletions
diff --git a/docs/ltn12.html b/docs/ltn12.html
index 30bc564..76b3984 100644
--- a/docs/ltn12.html
+++ b/docs/ltn12.html
@@ -55,6 +55,20 @@ To obtain the <tt>ltn12</tt> namespace, run:
55local ltn12 = require("ltn12") 55local ltn12 = require("ltn12")
56</pre> 56</pre>
57 57
58<!-- BLOCKSIZE +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
59
60<p class="name" id="BLOCKSIZE">
61ltn12.<b>BLOCKSIZE</b>
62</p>
63
64<p class="description">
65The default chunk size, in bytes, used internally by the built-in sources
66and sinks (e.g. <a href="#source.string"><tt>source.string</tt></a>,
67<a href="#source.file"><tt>source.file</tt></a>) when they have no more
68natural chunk size of their own. Defaults to 2048. Changing it affects
69only sources/sinks created after the change.
70</p>
71
58<!-- filters ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 72<!-- filters ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
59 73
60<h3 id="filter">Filters</h3> 74<h3 id="filter">Filters</h3>
@@ -415,6 +429,30 @@ ltn12.source.<b>table(</b>table<b>)</b>
415Creates and returns a source that produces the numerically-indexed values of a <tt>table</tt> successively beginning at 1. The source returns nil (end-of-stream) whenever a nil value is produced by the current index, which proceeds forward regardless. 429Creates and returns a source that produces the numerically-indexed values of a <tt>table</tt> successively beginning at 1. The source returns nil (end-of-stream) whenever a nil value is produced by the current index, which proceeds forward regardless.
416</p> 430</p>
417 431
432<!-- rewind +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
433
434<p class="name" id="source.rewind">
435ltn12.source.<b>rewind(</b>source<b>)</b>
436</p>
437
438<p class="description">
439Wraps a <em>fancy</em> <tt>source</tt> to add chunk pushback, so previously
440produced chunks can be fed back in for a later read to consume again.
441</p>
442
443<p class="parameters">
444<tt>Source</tt> is the fancy source being wrapped.
445</p>
446
447<p class="return">
448The function returns a new fancy source. Calling it with no arguments reads
449the next chunk as usual: any chunks previously pushed back are returned
450first (most recently pushed back, first), and once none remain it falls
451through to <tt>source</tt>. Calling it <em>with</em> a chunk argument does
452not read anything: it pushes that chunk back onto the internal stack for a
453future no-argument call to return.
454</p>
455
418<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 456<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
419 457
420<div class="footer"> 458<div class="footer">