diff options
author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2003-08-31 01:00:15 +0000 |
---|---|---|
committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2003-08-31 01:00:15 +0000 |
commit | 982781f1464c9b7a8133130433f83dbf1f59a2c0 (patch) | |
tree | 8f96f9e9fa1e6bef8b8356037986ddc18673cade /doc/index.html | |
parent | 6789b83ff5c15296267f880d3b98cf8a1800c30a (diff) | |
download | luasocket-982781f1464c9b7a8133130433f83dbf1f59a2c0.tar.gz luasocket-982781f1464c9b7a8133130433f83dbf1f59a2c0.tar.bz2 luasocket-982781f1464c9b7a8133130433f83dbf1f59a2c0.zip |
LuaSocket 2.0 User's Manual.
Diffstat (limited to 'doc/index.html')
-rw-r--r-- | doc/index.html | 212 |
1 files changed, 212 insertions, 0 deletions
diff --git a/doc/index.html b/doc/index.html new file mode 100644 index 0000000..46642d2 --- /dev/null +++ b/doc/index.html | |||
@@ -0,0 +1,212 @@ | |||
1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" | ||
2 | "http://www.w3.org/TR/html4/strict.dtd"> | ||
3 | <html> | ||
4 | |||
5 | <head> | ||
6 | <title>LuaSocket: Network support for the Lua language </title> | ||
7 | <link rel="stylesheet" href="reference.css" type="text/css"> | ||
8 | </head> | ||
9 | |||
10 | <body> | ||
11 | |||
12 | <!-- header +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | ||
13 | |||
14 | <div class=header> | ||
15 | <hr> | ||
16 | <center> | ||
17 | <table summary="LuaSocket logo"> | ||
18 | <tr><td align=center><a href="http://www.lua.org"> | ||
19 | <img border=0 alt="LuaSocket" src="luasocket.png"> | ||
20 | </a></td></tr> | ||
21 | <tr><td align=center valign=top>Network support for the Lua language | ||
22 | </td></tr> | ||
23 | </table> | ||
24 | <p class=bar> | ||
25 | <a href="home.html">home</a> · | ||
26 | <a href="home.html#download">download</a> · | ||
27 | <a href="introduction.html">introduction</a> · | ||
28 | <a href="reference.html">reference</a> | ||
29 | </p> | ||
30 | </center> | ||
31 | <hr> | ||
32 | </div> | ||
33 | |||
34 | <!-- whatis +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | ||
35 | |||
36 | <h2 id=whatis>What is LuaSocket?</h2> | ||
37 | |||
38 | <p> | ||
39 | LuaSocket is a <a href="http://www.lua.org">Lua</a> extension library | ||
40 | that is composed by two parts: a C layer that provides support for the TCP | ||
41 | and UDP transport layers, and a set of Lua modules that add support for | ||
42 | the SMTP (sending e-mails), HTTP (WWW access) and FTP (uploading and | ||
43 | downloading files) protocols. | ||
44 | </p> | ||
45 | |||
46 | <p> | ||
47 | Network support has been implemented so that it is both efficient and | ||
48 | simple to use. LuaSocket can be used by any Lua application once it has | ||
49 | been properly linked with and initialized by the interpreter running the | ||
50 | Lua application. The code has been tested and runs well on several Windows | ||
51 | and Unix platforms. | ||
52 | </p> | ||
53 | |||
54 | <p> | ||
55 | The library is available under the same | ||
56 | <a href="http://www.lua.org/copyright.html"> | ||
57 | terms and conditions</a> as the Lua language, the MIT license. The idea is | ||
58 | that if you can use Lua in a project, you should also be able to use | ||
59 | LuaSocket. | ||
60 | </p> | ||
61 | |||
62 | <p> | ||
63 | Copyright © 1999-2003 Tecgraf/PUC-Rio. All rights reserved. <br> | ||
64 | Author: <A href="http://www.cs.princeton.edu/~diego">Diego Nehab</a> | ||
65 | </p> | ||
66 | |||
67 | <!-- download +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | ||
68 | |||
69 | <h2 id=down>Download</h2> | ||
70 | |||
71 | <p> | ||
72 | LuaSocket version 2.0 alpha is now available for download! It is | ||
73 | compatible with Lua 5.0 and has been tested on | ||
74 | Windows XP, Linux, and Mac OS X. | ||
75 | </p> | ||
76 | |||
77 | <p> | ||
78 | The library can be downloaded in source code from the following links: | ||
79 | </p> | ||
80 | |||
81 | <blockquote> | ||
82 | <p> | ||
83 | <a href="luasocket-2.0-alpha.tar.gz">luasocket-2.0-alpha.tar.gz</a> <br> | ||
84 | <a href="luasocket-2.0-alpha.zip">luasocket-2.0-alpha.zip</a> | ||
85 | </p> | ||
86 | </blockquote> | ||
87 | |||
88 | <p> | ||
89 | Besides the full C and Lua source code for the library, the distribution | ||
90 | contains several examples, this user's manual and the test procedures. | ||
91 | </p> | ||
92 | |||
93 | <p> | ||
94 | I am also providing a Windows binary for those that want to give | ||
95 | LuaSocket a quick try: | ||
96 | </p> | ||
97 | |||
98 | <blockquote> | ||
99 | <p> | ||
100 | <a href="luasocket-2.0.exe">luasocket-2.0.exe</a> | ||
101 | </p> | ||
102 | </blockquote> | ||
103 | |||
104 | <p> | ||
105 | This binary has been compiled with the <tt>LUASOCKET_DEBUG</tt> | ||
106 | option, and should be able to run the automatic test procedures. | ||
107 | </p> | ||
108 | |||
109 | <!-- whatsnew +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | ||
110 | |||
111 | <h2 id=new>What's New</h2> | ||
112 | |||
113 | <p> | ||
114 | Most of the changes for 2.0 happened in the C layer, which | ||
115 | has been almost completely rewritten. The code has been ported to Lua 5.0 | ||
116 | and greatly improved. There have also been some API changes | ||
117 | that made the interface simpler and more consistent. Here are some of | ||
118 | the changes that made it into version 2.0: | ||
119 | </p> | ||
120 | |||
121 | <ul> | ||
122 | <li> Major C code rewrite. Code is modular and extensible. Hopefully, next | ||
123 | versions will include code for local domain sockets, file descriptors, | ||
124 | pipes (on Unix) and named pipes (on windows) as a bonus; | ||
125 | |||
126 | <li> Following the Lua 5.0 trend, all functions provided by the library are | ||
127 | in the namespace <tt>socket</tt>. Functions such as | ||
128 | send/receive/timeout/close etc do not exist anymore as stand-alone | ||
129 | functions. They are now only available as methods of the appropriate | ||
130 | objects; | ||
131 | |||
132 | <li> All functions return a non-nil value as first return value if successful. | ||
133 | All functions return whatever could be retrieved followed by error message | ||
134 | in case of error. The best way to check for errors is to check for the | ||
135 | presence of an error message; | ||
136 | |||
137 | <li> UDP connected sockets can break association with peer by calling | ||
138 | <tt>setpeername</tt> with address '<tt>*</tt>'; | ||
139 | |||
140 | <li> TCP has been changed to become more uniform. First create an object, | ||
141 | then connect or bind if needed, and finally use I/O functions. The | ||
142 | <tt>socket.connect</tt> and <tt>socket.bind</tt> functions are still | ||
143 | provided for simplicity, but they just call <tt>socket.tcp</tt> followed | ||
144 | by the <tt>connect</tt> or <tt>bind</tt> methods; | ||
145 | |||
146 | <li> Better error messages and parameter checking; | ||
147 | |||
148 | <li> <tt>socket.sleep</tt> and <tt>socket.time</tt> are now part of the | ||
149 | library and are supported. They used to be available only when | ||
150 | LUASOCKET_DEBUG was defined, but it turns out they might be useful for | ||
151 | applications; | ||
152 | |||
153 | <li> Socket options interface has been improved and TCP objects also | ||
154 | support socket options. | ||
155 | |||
156 | </ul> | ||
157 | |||
158 | <!-- incompatible +++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | ||
159 | |||
160 | <h3 id=incompatible>Incompatibilities with previous versions</h3> | ||
161 | |||
162 | <ul> | ||
163 | <li> The introduction of namespaces affects all programs that use LuaSocket, | ||
164 | specially code that relies on global functions. These are no longer | ||
165 | available. Note that even the support modules (<tt>http</tt>, <tt>smtp</tt> | ||
166 | etc) have been moved to the namespace (i.e. <tt>socket.http</tt>, | ||
167 | <tt>socket.smtp</tt> etc); | ||
168 | |||
169 | <li> WARNING: The new <tt>send</tt>, | ||
170 | <tt>sendto</tt>, <tt>setpeername</tt> and <tt>setsockname</tt>, | ||
171 | <tt>ftp.put</tt>, <tt>ftp.put_cb</tt> return convention WILL break old code; | ||
172 | |||
173 | <li> Interface to options has changed; | ||
174 | |||
175 | <li> <tt>socket.select</tt> refuses tables that have anything that is not | ||
176 | an object from the group <tt>select{able}</tt>. This includes even the | ||
177 | '<tt>n</tt>' field. Silently ignoring objects was a source of bugs for Lua | ||
178 | programs. | ||
179 | </ul> | ||
180 | |||
181 | <!-- old ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | ||
182 | |||
183 | <h2 id=old>Old Versions</h2> | ||
184 | |||
185 | <p> | ||
186 | All previous versions of the LuaSocket library can be downloaded | ||
187 | <a href="http://www.tecgraf.puc-rio.br/luasocket/old">here</a>. Although | ||
188 | these versions are no longer supported, they are still available for | ||
189 | those that have compatibility issues. | ||
190 | </p> | ||
191 | |||
192 | <!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | ||
193 | |||
194 | <div class=footer> | ||
195 | <hr> | ||
196 | <center> | ||
197 | <p class=bar> | ||
198 | <a href="home.html#down">download</a> · | ||
199 | <a href="introduction.html">introduction</a> · | ||
200 | <a href="reference.html">reference</a> | ||
201 | </p> | ||
202 | <p> | ||
203 | <small> | ||
204 | Last modified by Diego Nehab on <br> | ||
205 | Sun Aug 10 01:36:26 PDT 2003 | ||
206 | </small> | ||
207 | </p> | ||
208 | </center> | ||
209 | </div> | ||
210 | |||
211 | </body> | ||
212 | </html> | ||