diff options
author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-11-29 06:55:47 +0000 |
---|---|---|
committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-11-29 06:55:47 +0000 |
commit | 4e5ad6d5ee9e72ddf6550a6795c18039b265e501 (patch) | |
tree | 0feae12e5053cde90e3cc419de7cacc56851b459 /doc | |
parent | 6abfbc742b52ef2f94bc5120781d346200535f63 (diff) | |
download | luasocket-4e5ad6d5ee9e72ddf6550a6795c18039b265e501.tar.gz luasocket-4e5ad6d5ee9e72ddf6550a6795c18039b265e501.tar.bz2 luasocket-4e5ad6d5ee9e72ddf6550a6795c18039b265e501.zip |
Bug in poll.
Debug garbage in compat-5.1.c.
Improvements to the user manual.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/index.html | 38 | ||||
-rw-r--r-- | doc/installation.html | 38 | ||||
-rw-r--r-- | doc/introduction.html | 16 |
3 files changed, 49 insertions, 43 deletions
diff --git a/doc/index.html b/doc/index.html index 7141931..727066e 100644 --- a/doc/index.html +++ b/doc/index.html | |||
@@ -47,22 +47,20 @@ functionality commonly needed by applications that deal with the Internet. | |||
47 | 47 | ||
48 | <p> | 48 | <p> |
49 | The core support has been implemented so that it is both efficient and | 49 | The core support has been implemented so that it is both efficient and |
50 | simple to use. The core can be used by any Lua application once it has | 50 | simple to use. It is available to any Lua application once it has been |
51 | been properly initialized by the interpreter running the | 51 | properly initialized by the interpreter in use. The code has been tested |
52 | Lua application. The code has been tested and runs well on several Windows | 52 | and runs well on several Windows and Unix platforms. </p> |
53 | and Unix platforms. | ||
54 | </p> | ||
55 | 53 | ||
56 | <p> | 54 | <p> |
57 | The most used modules implement the | 55 | Among the support modules, the most commonly used implement the |
58 | <a href=smtp.html>SMTP</a> | 56 | <a href=smtp.html>SMTP</a> |
59 | (sending e-mails), | 57 | (sending e-mails), |
60 | <a href=http.html>HTTP</a> | 58 | <a href=http.html>HTTP</a> |
61 | (WWW access) and | 59 | (WWW access) and |
62 | <a href=ftp.html>FTP</a> | 60 | <a href=ftp.html>FTP</a> |
63 | (uploading and downloading files) client | 61 | (uploading and downloading files) client |
64 | protocols. These provide a very natural and generic interface to the e | 62 | protocols. These provide a very natural and generic interface to the |
65 | functionality covered by the protocols. | 63 | functionality defined by each protocol. |
66 | In addition, you will find that the | 64 | In addition, you will find that the |
67 | <a href=mime.html>MIME</a> (common encodings), | 65 | <a href=mime.html>MIME</a> (common encodings), |
68 | <a href=url.html>URL</a> | 66 | <a href=url.html>URL</a> |
@@ -107,12 +105,12 @@ The library can be downloaded in source code from the following links: | |||
107 | 105 | ||
108 | <p> | 106 | <p> |
109 | Besides the full C and Lua source code for the library, the distribution | 107 | Besides the full C and Lua source code for the library, the distribution |
110 | contains several examples, this user's manual and the test procedures. | 108 | contains several examples, this user's manual and basic test procedures. |
111 | </p> | 109 | </p> |
112 | 110 | ||
113 | <p> | 111 | <p> |
114 | I am also providing PC Win32 binaries for those that want to give | 112 | I am also providing PC Win32 binaries for those that want to give |
115 | LuaSocket a quick try: | 113 | LuaSocket a try (Those on Unix or Mac OS X can just type <tt>make</tt>): |
116 | </p> | 114 | </p> |
117 | 115 | ||
118 | <blockquote> | 116 | <blockquote> |
@@ -126,12 +124,12 @@ The quick and dirty way to use these binaries is to unpack everything into a | |||
126 | directory, say <tt>c:\luasocket</tt> (include all Lua files from the | 124 | directory, say <tt>c:\luasocket</tt> (include all Lua files from the |
127 | LuaSocket distrbitution in the same directory too!). | 125 | LuaSocket distrbitution in the same directory too!). |
128 | Then set <tt>LUA_INIT</tt> to load the <tt>compat-5.1.lua</tt> and set | 126 | Then set <tt>LUA_INIT</tt> to load the <tt>compat-5.1.lua</tt> and set |
129 | <tt>LUA_PATH</tt> and <tt>LUA_CPATH</tt> to look for files in that | 127 | <tt>LUA_PATH</tt> and <tt>LUA_CPATH</tt> to look for files in the current |
130 | directory: | 128 | directory: |
131 | </p> | 129 | </p> |
132 | 130 | ||
133 | <pre class=example> | 131 | <pre class=example> |
134 | c:\luasocket\> set LUA_INIT=@compat-5.1.lua | 132 | c:\luasocket\> set LUA_INIT=@c:\luasocket\compat-5.1.lua |
135 | c:\luasocket\> set LUA_CPATH=?.dll | 133 | c:\luasocket\> set LUA_CPATH=?.dll |
136 | c:\luasocket\> set LUA_PATH=?.lua | 134 | c:\luasocket\> set LUA_PATH=?.lua |
137 | </pre> | 135 | </pre> |
@@ -147,12 +145,12 @@ c:\luasocket\> lua | |||
147 | Lua 5.0.2 Copyright (C) 1994-2004 Tecgraf, PUC-Rio | 145 | Lua 5.0.2 Copyright (C) 1994-2004 Tecgraf, PUC-Rio |
148 | > http = require"http" | 146 | > http = require"http" |
149 | > print(http.request"http://www.tecgraf.puc-rio.br/luasocket/") | 147 | > print(http.request"http://www.tecgraf.puc-rio.br/luasocket/") |
150 | --> this gets dumped to terminal | 148 | --> the source to this webpage gets dumped to terminal |
151 | </pre> | 149 | </pre> |
152 | 150 | ||
153 | <p> Take a look at the <a href=instalation.html>installation</a> section of | 151 | <p> When you are done playing, take a look at the |
154 | the manual to find out how to properly install the library after you are | 152 | <a href=instalation.html>installation</a> section of the manual to find out |
155 | done playing with it. </p> | 153 | how to properly install the library. </p> |
156 | 154 | ||
157 | <!-- thanks +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | 155 | <!-- thanks +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> |
158 | 156 | ||
@@ -175,7 +173,7 @@ has been helping a lot too! Thanks to you all! | |||
175 | 173 | ||
176 | <p> | 174 | <p> |
177 | The big change for the 2.0 (beta3) release was the adoption of the Lua 5.1 | 175 | The big change for the 2.0 (beta3) release was the adoption of the Lua 5.1 |
178 | package proposal. There were several bug fixes too (a beta is a | 176 | package proposal. Naturally, there were a few bug fixes (a beta is a |
179 | beta, is a beta). | 177 | beta, is a beta). |
180 | </p> | 178 | </p> |
181 | 179 | ||
@@ -195,7 +193,7 @@ beta, is a beta). | |||
195 | <li> Fixed <tt>udp:sendto</tt> to call <tt>sock_sendto</tt> instead of | 193 | <li> Fixed <tt>udp:sendto</tt> to call <tt>sock_sendto</tt> instead of |
196 | <tt>sock_send</tt>; | 194 | <tt>sock_send</tt>; |
197 | <li> <tt>close</tt> wasn't returning 1! | 195 | <li> <tt>close</tt> wasn't returning 1! |
198 | <li> <tt>socket.gettime</tt> returns time since Unix Epoch 1/1/1970 (UTC) | 196 | <li> <tt>socket.gettime</tt> returns time since Unix Epoch 1/1/1970 (UTC); |
199 | <li> <tt>socket.sleep</tt> is robust to interrupts; | 197 | <li> <tt>socket.sleep</tt> is robust to interrupts; |
200 | <li> <tt>socket.select</tt> wasn't calling <tt>tm_markstart</tt>; | 198 | <li> <tt>socket.select</tt> wasn't calling <tt>tm_markstart</tt>; |
201 | <li> <tt>http.PROXY</tt> wasn't working. | 199 | <li> <tt>http.PROXY</tt> wasn't working. |
@@ -206,8 +204,8 @@ beta, is a beta). | |||
206 | <h3 id=incompatible>Incompatibilities with previous versions</h3> | 204 | <h3 id=incompatible>Incompatibilities with previous versions</h3> |
207 | 205 | ||
208 | <ul> | 206 | <ul> |
209 | <li> Namespaces are hierarchical again. This means that whoever called | 207 | <li> Namespaces are hierarchical again. This means that whoever used to |
210 | <tt>require("url")</tt> should update their code to | 208 | call <tt>require("url")</tt> should update their code to |
211 | <tt>require("socket.url")</tt>. | 209 | <tt>require("socket.url")</tt>. |
212 | </ul> | 210 | </ul> |
213 | 211 | ||
diff --git a/doc/installation.html b/doc/installation.html index 97888c6..63a555c 100644 --- a/doc/installation.html +++ b/doc/installation.html | |||
@@ -39,24 +39,32 @@ Installation"> | |||
39 | 39 | ||
40 | <h2>Instalation</h2> | 40 | <h2>Instalation</h2> |
41 | 41 | ||
42 | <p> LuaSocket 2.0 uses the new package proposal for Lua 5.1, throught the | 42 | <p> LuaSocket 2.0 uses the new package proposal for Lua 5.1. |
43 | compatibility module <a href=http://www.keplerproject.org/compat/> | 43 | All Lua library developers are encouraged to update their libraries so that |
44 | Compat-5.1</a> released in conjunction with Roberto Ierusalimschy and <a | 44 | all libraries can coexist peacefully and users can benefit from the |
45 | href=http://www.keplerproject.org/">The Kepler project</a>. The proposal | 45 | standardization and flexibility of the standard. |
46 | was considered important enough by the community to justify early adoption. | 46 | </p> |
47 | All Lua library developers are encouraged to change their libraries in | 47 | |
48 | preparation for the release of Lua 5.1. </p> | 48 | <p> |
49 | The proposal was considered important enough by some of us to justify | ||
50 | early adoption, even before release of Lua 5.1. | ||
51 | Thus, a compability module | ||
52 | <a href=http://www.keplerproject.org/compat/>compat-5.1</a> | ||
53 | has been released in conjunction with Roberto Ierusalimschy and <a | ||
54 | href=http://www.keplerproject.org/">The Kepler Project</a> team. | ||
55 | It implements the Lua 5.1 package proposal on top of Lua 5.0. </p> | ||
49 | 56 | ||
50 | <p> As far as LuaSocket is concerned, this means that whoever is | 57 | <p> As far as LuaSocket is concerned, this means that whoever is |
51 | deploying a solution that uses LuaSocket has a lot of freedom. Here we | 58 | deploying a non-standard distribution of LuaSocket will probably |
52 | describe only the standard distribution. If the standard doesn't meet your | 59 | have no problems customizing it. Here we will only describe the standard distribution. If the standard doesn't meet your |
53 | needs, we refer you to the Lua discussion list, where any quesetion about | 60 | needs, we refer you to the Lua discussion list, where any question about |
54 | the package scheme will likely be answered promptly. | 61 | the package scheme will likely already have been answered. |
55 | </p> | 62 | </p> |
56 | 63 | ||
57 | <h3>Directory structure</h3> | 64 | <h3>Directory structure</h3> |
58 | 65 | ||
59 | <p> The new package scheme has a root directory for the libraries installed | 66 | <p> The standard distribution reserves a directory to be the root of |
67 | the libraries installed | ||
60 | on a given system. Let's call this directory <tt><ROOT></tt>. | 68 | on a given system. Let's call this directory <tt><ROOT></tt>. |
61 | On my system, this is the <tt>/usr/local/share/lua/5.0</tt> directory. | 69 | On my system, this is the <tt>/usr/local/share/lua/5.0</tt> directory. |
62 | Here is the standard LuaSocket distribution directory structure:</p> | 70 | Here is the standard LuaSocket distribution directory structure:</p> |
@@ -82,7 +90,7 @@ X, they would be replaced by <tt>lsocket.dylib</tt> and | |||
82 | 90 | ||
83 | <p> In order for the interpreter to find all LuaSocket components, three | 91 | <p> In order for the interpreter to find all LuaSocket components, three |
84 | environment variables need to be set. The first environment variable tells | 92 | environment variables need to be set. The first environment variable tells |
85 | the interpreter to load the <tt>compat-5.1.lua</tt> module. </p> | 93 | the interpreter to load the <tt>compat-5.1.lua</tt> module at startup: </p> |
86 | 94 | ||
87 | <pre class=example> | 95 | <pre class=example> |
88 | LUA_INIT=@<ROOT>/compat-5.1.lua | 96 | LUA_INIT=@<ROOT>/compat-5.1.lua |
@@ -98,7 +106,7 @@ LUA_CPATH=<ROOT>/?.dll;?.dll | |||
98 | </pre> | 106 | </pre> |
99 | 107 | ||
100 | <p> Again, naturally, in Unix the shared library extension would be | 108 | <p> Again, naturally, in Unix the shared library extension would be |
101 | <tt>.so</tt> instead of <tt>.dll</tt> and on Mac OS X they would be | 109 | <tt>.so</tt> instead of <tt>.dll</tt> and on Mac OS X it would be |
102 | <tt>.dylib</tt></p> | 110 | <tt>.dylib</tt></p> |
103 | 111 | ||
104 | <h3>Using LuaSocket</h3> | 112 | <h3>Using LuaSocket</h3> |
@@ -115,7 +123,7 @@ Lua 5.0.2 Copyright (C) 1994-2004 Tecgraf, PUC-Rio | |||
115 | </pre> | 123 | </pre> |
116 | 124 | ||
117 | <p> Each module loads their dependencies automatically, so you only need to | 125 | <p> Each module loads their dependencies automatically, so you only need to |
118 | load the modues you are directly dependent upon. <p> | 126 | load the modues you directly depend upon: <p> |
119 | 127 | ||
120 | <pre class=example> | 128 | <pre class=example> |
121 | Lua 5.0.2 Copyright (C) 1994-2004 Tecgraf, PUC-Rio | 129 | Lua 5.0.2 Copyright (C) 1994-2004 Tecgraf, PUC-Rio |
diff --git a/doc/introduction.html b/doc/introduction.html index 69a5eac..150a990 100644 --- a/doc/introduction.html +++ b/doc/introduction.html | |||
@@ -58,7 +58,7 @@ interface to I/O across different domains and operating systems. | |||
58 | </p> | 58 | </p> |
59 | 59 | ||
60 | <p> | 60 | <p> |
61 | The LuaSocket API was designed with two goals in mind. First, users | 61 | The API design had two goals in mind. First, users |
62 | experienced with the C API to sockets should feel comfortable using LuaSocket. | 62 | experienced with the C API to sockets should feel comfortable using LuaSocket. |
63 | Second, the simplicity and the feel of the Lua language should be | 63 | Second, the simplicity and the feel of the Lua language should be |
64 | preserved. To achieve these goals, the LuaSocket API keeps the function names and semantics the C API whenever possible, but their usage in Lua has been greatly simplified. | 64 | preserved. To achieve these goals, the LuaSocket API keeps the function names and semantics the C API whenever possible, but their usage in Lua has been greatly simplified. |
@@ -94,7 +94,7 @@ call might perform several OS calls, so that the two timeout values are | |||
94 | Finally, the host name resolution is transparent, meaning that most | 94 | Finally, the host name resolution is transparent, meaning that most |
95 | functions and methods accept both IP addresses and host names. In case a | 95 | functions and methods accept both IP addresses and host names. In case a |
96 | host name is given, the library queries the system's resolver and | 96 | host name is given, the library queries the system's resolver and |
97 | tries the main returned IP address. Note that direct use of IP addresses | 97 | tries the main IP address returned. Note that direct use of IP addresses |
98 | is more efficient, of course. The | 98 | is more efficient, of course. The |
99 | <a href=dns.html#toip><tt>toip</tt></a> | 99 | <a href=dns.html#toip><tt>toip</tt></a> |
100 | and <a href=dns.html#tohostname><tt>tohostname</tt></a> | 100 | and <a href=dns.html#tohostname><tt>tohostname</tt></a> |
@@ -299,14 +299,14 @@ io.write(socket.try((udp:receive()))) | |||
299 | 299 | ||
300 | <!-- More +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | 300 | <!-- More +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> |
301 | 301 | ||
302 | <h3 id=more>Much more</h3> | 302 | <h3 id=more>Support modules</h3> |
303 | 303 | ||
304 | <p> LuaSocket offers much more than TCP and UDP support. As the library | 304 | <p> Although not covered in the introduction, LuaSocket offers |
305 | much more than TCP and UDP functionality. As the library | ||
305 | evolved, support for <a href=http.html>HTTP</a>, <a href=ftp.html>FTP</a>, | 306 | evolved, support for <a href=http.html>HTTP</a>, <a href=ftp.html>FTP</a>, |
306 | <a href=smtp.html>SMTP</a>, <a href=mime.html>MIME</a>, <a | 307 | and <a href=smtp.html>SMTP</a> were built on top of these. These modules |
307 | href=url.html>URLs</a> and much more was made available.</a> These are | 308 | and many others are covered by the <a href=reference.html>reference manual</a>. |
308 | mostly implemented in Lua itself, with critical parts implemented in C for | 309 | </p> |
309 | efficiency</p> | ||
310 | 310 | ||
311 | <!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | 311 | <!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> |
312 | 312 | ||