aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2004-07-26 04:04:04 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2004-07-26 04:04:04 +0000
commitd914007507a6a4ad3489cca19652af403fef7074 (patch)
tree71f83f3ce04c5c7852c0571d3f9fe0188c920784 /doc
parentcd994f306a67ea7b9ee0ba810d985114e097dd77 (diff)
downloadluasocket-d914007507a6a4ad3489cca19652af403fef7074.tar.gz
luasocket-d914007507a6a4ad3489cca19652af403fef7074.tar.bz2
luasocket-d914007507a6a4ad3489cca19652af403fef7074.zip
Almost ready for beta2.
Diffstat (limited to 'doc')
-rw-r--r--doc/index.html144
-rw-r--r--doc/socket.html4
-rw-r--r--doc/tcp.html27
3 files changed, 59 insertions, 116 deletions
diff --git a/doc/index.html b/doc/index.html
index abba703..8eaa37a 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -88,7 +88,7 @@ Author: <A href="http://www.cs.princeton.edu/~diego">Diego Nehab</a>
88<h2 id=download>Download</h2> 88<h2 id=download>Download</h2>
89 89
90<p> 90<p>
91LuaSocket version 2.0 beta is now available for download! It is 91LuaSocket version 2.0 beta2 is now available for download! It is
92compatible with Lua&nbsp;5.0 and has been tested on 92compatible with Lua&nbsp;5.0 and has been tested on
93Windows&nbsp;XP, Linux, and Mac OS X. 93Windows&nbsp;XP, Linux, and Mac OS X.
94</p> 94</p>
@@ -99,8 +99,8 @@ The library can be downloaded in source code from the following links:
99 99
100<blockquote> 100<blockquote>
101<p> 101<p>
102<a href="luasocket-2.0-beta.tar.gz">luasocket-2.0-beta.tar.gz</a> <br> 102<a href="luasocket-2.0-beta2.tar.gz">luasocket-2.0-beta2.tar.gz</a> <br>
103<a href="luasocket-2.0-beta.zip">luasocket-2.0-beta.zip</a> 103<a href="luasocket-2.0-beta2.zip">luasocket-2.0-beta2.zip</a>
104</p> 104</p>
105</blockquote> 105</blockquote>
106 106
@@ -116,7 +116,7 @@ LuaSocket a quick try:
116 116
117<blockquote> 117<blockquote>
118<p> 118<p>
119<a href="luasocket-2.0-beta-win32.zip">luasocket-2.0-beta-win32.zip</a> 119<a href="luasocket-2.0-beta2-win32.zip">luasocket-2.0-beta2-win32.zip</a>
120</p> 120</p>
121</blockquote> 121</blockquote>
122 122
@@ -156,104 +156,43 @@ Special thanks go to
156David Burgess, who has helped push the library to a new level of quality and 156David Burgess, who has helped push the library to a new level of quality and
157from whom I have learned a lot of stuff that doesn't show up in RFCs. 157from whom I have learned a lot of stuff that doesn't show up in RFCs.
158Special thanks also to Carlos Cassino, who played a big part in the 158Special thanks also to Carlos Cassino, who played a big part in the
159extensible design seen in the C core of LuaSocket 2.0. 159extensible design seen in the C core of LuaSocket 2.0. Recently, Mike Pall
160has been helping a lot too! Thanks to you all!
160</p> 161</p>
161 162
162<!-- whatsnew +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 163<!-- whatsnew +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
163 164
164<h2 id=new>What's New</h2> 165<h2 id=new>What's New</h2>
165 166
166
167<p>
168<em>Everything</em> is new! Many changes for 2.0 happened in the C layer,
169which has been almost completely rewritten. The code has been ported to
170Lua 5.0 and greatly improved. There have also been some API changes
171that made the interface simpler and more consistent. Here are some of
172the changes that made it into version 2.0:
173</p>
174
175<ul>
176<li> Major C code rewrite. Code is modular and extensible. Hopefully, other
177 developers will be motivated to provide code for SSL, local domain
178 sockets, file descriptors, pipes (on Unix) and named pipes etc;
179
180<li> Everything that is exported by the library is exported inside
181 namespaces. These should be obtained with calls to the
182 <tt>require</tt> function;
183
184<li> Functions such as
185 send/receive/timeout/close etc do not exist anymore as stand-alone
186 functions. They are now only available as methods of the appropriate
187 objects;
188
189<li> All functions return a non-nil value as first return value if successful.
190 All functions return <b><tt>nil</tt></b> followed by error message
191 in case of error. This made the library much easier to use;
192
193<li> Greatly reduced the number of times the C select is called
194 during data transfers, by calling only on failure. This might
195 improve a lot the maximum throughput;
196
197<li> TCP has been changed to become more uniform. It's possible to first
198 create a TCP object,
199 then connect or bind if needed, and finally use I/O functions.
200 <tt>socket.connect</tt> and <tt>socket.bind</tt> functions are still
201 provided for simplicity;
202
203<li> This allows for setting a timeout value before connecting;
204
205<li> And also allows binding to a local address before connecting;
206
207<li> New <tt>socket.dns.gethostname</tt> function and <tt>shutdown</tt>
208 method;
209
210<li> Better error messages and parameter checking;
211
212<li> Should be interrupt safe;
213
214<li> UDP connected sockets can break association with peer by calling
215 <tt>setpeername</tt> with address '<tt>*</tt>';
216
217<li> Sets returned by <tt>socket.select</tt> are associative;
218
219<li> Select checks if sockets have buffered data and returns immediately;
220
221<li> <tt>socket.sleep</tt> and <tt>socket.gettime</tt> are now part of the
222 library and are supported. They used to be available only when
223 LUASOCKET_DEBUG was defined, but it turns out they might be useful for
224 applications;
225
226<li> <tt>socket.try</tt> and <tt>socket.protect</tt> provide a simple
227 interface to exceptions that proved very in the implementation of
228 high-level modules;
229
230<li> Socket options interface has been improved. TCP objects also
231 support socket options and many new options were added.
232
233</ul>
234
235<p> 167<p>
236Lots of changes in the Lua modules, too! 168Changes in the 2.0-beta2 were mostly bug-fixes.
237</p> 169</p>
238 170
239<ul> 171<ul>
240<li> Every module loads only the modules that it needs. There is no waste 172<li> Fixed silly last minute bugs in HTTP/SMTP that prevented them from
241of memory. LuaSocket core takes only 20k of memory; 173running;
242 174<li> <tt>usocket.c</tt>/<tt>wsocket.c</tt> look nicer thanks to Mike;
243<li> New MIME and LTN12 modules make all other modules much more powerful; 175<li> UDP has a reasonable maximum datagram size;
244 176<li> <tt>Receive</tt> accepts the prefix optional argument (good for
245<li> Support for multipart messages in the SMTP module; 177non-blocking);
246 178<li> <b><tt>Send</tt> doesn't support multiple arguments anymore</b>;
247<li> The old callback mechanism of FTP and HTTP has been replaced with LTN12 sources and sinks, with advantage; 179<li> Instead, <tt>send</tt> allows the selection of the substring
248 180to be sent (good for non-blocking);
249<li> Common implementation for low-level FTP and SMTP; 181<li> Fixed bug that caused select return tables not to be associative
250 182on windows;
251<li> FTP, HTTP, and SMTP are implemented in multiple levels in such a way 183<li> Should compiles with g++;
252that users will have no problems extending the functionality to satisfy 184<li> New sample unix domain support;
253personal needs; 185<li> New sample LPD support;
254 186<li> Comprehensive error messages;
255<li> SMTP knows how to perform LOGIN and PLAIN authentication. 187<li> New <tt>getstats</tt> and <tt>setstats</tt> methods to help throttling;
256 188<li> <tt>Listen</tt> defaults to 32 backlog;
189<li> SMTP/FTP/HTTP fail gracefully;
190<li> <tt>accept</tt>/<tt>connect</tt>/<tt>select</tt> interrupt safe
191<li> Fixed bug that didn't set accepted sockets as non-blocking
192<li> <b>New timming functions <tt>sleep</tt> and <tt>gettime</tt> have
193higher resolution and no wrap around problems</b>;
194<li> Bug fixes in the manual;
195<li> Fixed bug of missing cast in <tt>getfd</tt>.
257</ul> 196</ul>
258 197
259<!-- incompatible +++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 198<!-- incompatible +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
@@ -262,25 +201,8 @@ personal needs;
262 201
263<ul> 202<ul>
264 203
265<li> The introduction of namespaces affects all programs that use LuaSocket, 204<li> New <tt>send</tt> inteface doesn't send multiple arguments anymore;
266specially code that relies on global functions. These are no longer 205<li> <tt>Time</tt> is replaced by <tt>gettime</tt> with advantages.
267available. Note that even the support modules (<tt>http</tt>, <tt>smtp</tt>
268etc) are independent now and should be "<tt>require</tt>"d;
269
270<li> FTP, SMTP and HTTP are completely new; I am sure you will
271agree the new stuff is better;
272
273<li> WARNING: The new <tt>send</tt>, <tt><b>receive</b></tt>,
274<tt>sendto</tt>, <tt>setpeername</tt> and <tt>setsockname</tt>,
275return convention WILL break old code;
276
277<li> To enable local binding before connect, the <tt>bind</tt> method
278 does not call <tt>listen</tt> anymore. It is the new <tt>listen</tt>
279method that turns a TCP object into a server object;
280
281<li> <tt>socket.time</tt> changed to <tt>socket.gettime</tt> for uniformity;
282
283<li> Interface to options has changed.
284 206
285</ul> 207</ul>
286 208
diff --git a/doc/socket.html b/doc/socket.html
index 129b134..c7525eb 100644
--- a/doc/socket.html
+++ b/doc/socket.html
@@ -332,10 +332,6 @@ universe. You should subtract the values returned by this function
332to get meaningful values. 332to get meaningful values.
333</p> 333</p>
334 334
335<p class=return>
336The function returns the time as a number.
337</p>
338
339<pre class=example> 335<pre class=example>
340t = socket.gettime() 336t = socket.gettime()
341-- do stuff 337-- do stuff
diff --git a/doc/tcp.html b/doc/tcp.html
index 30e06f4..dfc2c29 100644
--- a/doc/tcp.html
+++ b/doc/tcp.html
@@ -213,10 +213,12 @@ The method returns a string with local IP address and a number with
213the port. In case of error, the method returns <b><tt>nil</tt></b>. 213the port. In case of error, the method returns <b><tt>nil</tt></b>.
214</p> 214</p>
215 215
216<!-- getsockname ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 216<!-- getstats +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
217 217
218<p class=name id=getstats> 218<p class=name id=getstats>
219master:<b>getstats()</b><br>
219client:<b>getstats()</b><br> 220client:<b>getstats()</b><br>
221server:<b>getstats()</b><br>
220</p> 222</p>
221 223
222<p class=description> 224<p class=description>
@@ -414,6 +416,29 @@ The method returns 1 in case of success, or <b><tt>nil</tt></b> otherwise.
414Note: The descriptions above come from the man pages. 416Note: The descriptions above come from the man pages.
415</p> 417</p>
416 418
419<!-- setstats +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
420
421<p class=name id=setstats>
422master:<b>setstats(</b>received, sent, age<b>)</b><br>
423client:<b>setstats(</b>received, sent, age<b>)</b><br>
424server:<b>setstats(</b>received, sent, age<b>)</b><br>
425</p>
426
427<p class=description>
428Resets accounting information on the socket, useful for throttling
429of bandwidth.
430</p>
431
432<p class=parameters>
433<tt>Received</tt> is a number with the new number of bytes received.
434<tt>Sent</tt> is a number with the new number of bytes sent.
435<tt>Age</tt> is the new age in seconds</tt>
436</p>
437
438<p class=return>
439The method returns 1 in case of success and <tt><b>nil</b></tt> otherwise.
440</p>
441
417<!-- settimeout +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 442<!-- settimeout +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
418 443
419<p class=name id=settimeout> 444<p class=name id=settimeout>