aboutsummaryrefslogtreecommitdiff
path: root/doc/udp.html
diff options
context:
space:
mode:
authorDiego Nehab <diego.nehab@gmail.com>2015-10-06 11:33:50 +0800
committerDiego Nehab <diego.nehab@gmail.com>2015-10-06 11:33:50 +0800
commitbe67f63f4e11e53690bf1431a236f86b484c9bf0 (patch)
tree2a9e3de162711f3453d238eb49155c4c488189ec /doc/udp.html
parentfd729b32a8966291f007567f72f3dc0158bdab35 (diff)
downloadluasocket-be67f63f4e11e53690bf1431a236f86b484c9bf0.tar.gz
luasocket-be67f63f4e11e53690bf1431a236f86b484c9bf0.tar.bz2
luasocket-be67f63f4e11e53690bf1431a236f86b484c9bf0.zip
Changed buffer-per-socket to buffer-per-operation.
This is a difficult tradeoff to measure. I think large datagrams won't be used very frequently. So it is better to not lock a large buffer to each socket object and instead allocate and deallocate for each operation receiving a datagram larger than UDP_DATAGRAMSIZE.
Diffstat (limited to 'doc/udp.html')
-rw-r--r--doc/udp.html33
1 files changed, 7 insertions, 26 deletions
diff --git a/doc/udp.html b/doc/udp.html
index 22d7c72..9437c51 100644
--- a/doc/udp.html
+++ b/doc/udp.html
@@ -42,7 +42,7 @@
42<!-- socket.udp ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 42<!-- socket.udp ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
43 43
44<p class="name" id="socket.udp"> 44<p class="name" id="socket.udp">
45socket.<b>udp(</b>[buffersize]<b>)</b> 45socket.<b>udp()</b>
46</p> 46</p>
47 47
48<p class="description"> 48<p class="description">
@@ -62,13 +62,6 @@ The <a href="#setpeername"><tt>setpeername</tt></a>
62is used to connect the object. 62is used to connect the object.
63</p> 63</p>
64 64
65<p class="parameters">
66The optional <tt>buffersize</tt> parameter
67specifies the size of the largest datagram that will
68ever be received by the UDP object. The default value is
698192.
70</p>
71
72<p class="return"> 65<p class="return">
73In case of success, a new unconnected UDP object 66In case of success, a new unconnected UDP object
74returned. In case of error, <b><tt>nil</tt></b> is returned, followed by 67returned. In case of error, <b><tt>nil</tt></b> is returned, followed by
@@ -92,7 +85,7 @@ href=#setoption><tt>setoption</tt></a> will fail.
92<!-- socket.udp4 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 85<!-- socket.udp4 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
93 86
94<p class="name" id="socket.udp"> 87<p class="name" id="socket.udp">
95socket.<b>udp4(</b>[buffersize]<b>)</b> 88socket.<b>udp4()</b>
96</p> 89</p>
97 90
98<p class="description"> 91<p class="description">
@@ -112,13 +105,6 @@ The <a href="#setpeername"><tt>setpeername</tt></a>
112is used to connect the object. 105is used to connect the object.
113</p> 106</p>
114 107
115<p class="parameters">
116The optional <tt>buffersize</tt> parameter
117specifies the size of the largest datagram that will
118ever be received by the UDP object. The default value is
1198192.
120</p>
121
122<p class="return"> 108<p class="return">
123In case of success, a new unconnected UDP object 109In case of success, a new unconnected UDP object
124returned. In case of error, <b><tt>nil</tt></b> is returned, followed by 110returned. In case of error, <b><tt>nil</tt></b> is returned, followed by
@@ -128,7 +114,7 @@ an error message.
128<!-- socket.udp ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 114<!-- socket.udp ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
129 115
130<p class="name" id="socket.udp6"> 116<p class="name" id="socket.udp6">
131socket.<b>udp6(</b>[buffersize]<b>)</b> 117socket.<b>udp6()</b>
132</p> 118</p>
133 119
134<p class="description"> 120<p class="description">
@@ -148,13 +134,6 @@ The <a href="#setpeername"><tt>setpeername</tt></a>
148is used to connect the object. 134is used to connect the object.
149</p> 135</p>
150 136
151<p class="parameters">
152The optional <tt>buffersize</tt> parameter
153specifies the size of the largest datagram that will
154ever be received by the UDP object. The default value is
1558192.
156</p>
157
158<p class="return"> 137<p class="return">
159In case of success, a new unconnected UDP object 138In case of success, a new unconnected UDP object
160returned. In case of error, <b><tt>nil</tt></b> is returned, followed by 139returned. In case of error, <b><tt>nil</tt></b> is returned, followed by
@@ -261,8 +240,10 @@ the excess bytes are discarded. If there are less then
261<tt>size</tt> bytes available in the current datagram, the 240<tt>size</tt> bytes available in the current datagram, the
262available bytes are returned. 241available bytes are returned.
263If <tt>size</tt> is omitted, the 242If <tt>size</tt> is omitted, the
264<tt>buffersize</tt> argument at creation time is used 243compile-time constant <a
265(which defaults to 8192 bytes). 244href=socket.html#datagramsize><tt>socket._DATAGRAMSIZE</tt></a> is used
245(it defaults to 8192 bytes). Larger sizes will cause a
246temporary buffer to be allocated for the operation.
266</p> 247</p>
267 248
268<p class="return"> 249<p class="return">