diff options
| author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-11-28 08:17:16 +0000 |
|---|---|---|
| committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-11-28 08:17:16 +0000 |
| commit | 534b0cedf714d4de0a6cf67570e11f232cdccf84 (patch) | |
| tree | 14b26a6a8460e57c9739025eb0e661f64bb78b4f /doc/introduction.html | |
| parent | 297b32e828b76ee544c9d4f89f996eda78830cc0 (diff) | |
| download | luasocket-534b0cedf714d4de0a6cf67570e11f232cdccf84.tar.gz luasocket-534b0cedf714d4de0a6cf67570e11f232cdccf84.tar.bz2 luasocket-534b0cedf714d4de0a6cf67570e11f232cdccf84.zip | |
Added new instalation section to the manual.
Diffstat (limited to 'doc/introduction.html')
| -rw-r--r-- | doc/introduction.html | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/doc/introduction.html b/doc/introduction.html index 20c4d36..a285b81 100644 --- a/doc/introduction.html +++ b/doc/introduction.html | |||
| @@ -4,7 +4,8 @@ | |||
| 4 | 4 | ||
| 5 | <head> | 5 | <head> |
| 6 | <meta name="description" content="LuaSocket: Introduction to the core"> | 6 | <meta name="description" content="LuaSocket: Introduction to the core"> |
| 7 | <meta name="keywords" content="Lua, Library, TCP, UDP, Network, Support"> | 7 | <meta name="keywords" content="Lua, LuaSocket, TCP, UDP, Network, |
| 8 | Library, Support"> | ||
| 8 | <title>LuaSocket: Introduction to the core</title> | 9 | <title>LuaSocket: Introduction to the core</title> |
| 9 | <link rel="stylesheet" href="reference.css" type="text/css"> | 10 | <link rel="stylesheet" href="reference.css" type="text/css"> |
| 10 | </head> | 11 | </head> |
| @@ -26,6 +27,7 @@ | |||
| 26 | <p class=bar> | 27 | <p class=bar> |
| 27 | <a href="home.html">home</a> · | 28 | <a href="home.html">home</a> · |
| 28 | <a href="home.html#download">download</a> · | 29 | <a href="home.html#download">download</a> · |
| 30 | <a href="instalation.html">instalation</a> · | ||
| 29 | <a href="introduction.html">introduction</a> · | 31 | <a href="introduction.html">introduction</a> · |
| 30 | <a href="reference.html">reference</a> | 32 | <a href="reference.html">reference</a> |
| 31 | </p> | 33 | </p> |
| @@ -104,29 +106,6 @@ Together, these changes make network programming in LuaSocket much simpler | |||
| 104 | than it is in C, as the following sections will show. | 106 | than it is in C, as the following sections will show. |
| 105 | </p> | 107 | </p> |
| 106 | 108 | ||
| 107 | <!-- initializing +++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | ||
| 108 | |||
| 109 | <h3>Initializing the library</h3> | ||
| 110 | |||
| 111 | <p> | ||
| 112 | The core LuaSocket is almost entirely implemented in C. It is | ||
| 113 | usually available as a dynamic library which the interpreter can load | ||
| 114 | with the help of a loader module written in Lua. | ||
| 115 | Beginning with version 2.0 and following the Lua 5.0 trend, all LuaSocket | ||
| 116 | functionality is defined inside tables (or rather namespaces). No global | ||
| 117 | variables are ever created. | ||
| 118 | Namespaces are obtained with the <tt>require</tt> Lua function, which loads | ||
| 119 | and initializes any required library and returns the namespace. | ||
| 120 | For example, the core functionality or LuaSocket is usually available | ||
| 121 | from the "<tt>socket</tt>" namespace. | ||
| 122 | </p> | ||
| 123 | |||
| 124 | <pre class="example"> | ||
| 125 | socket = require("socket") | ||
| 126 | print(socket.VERSION) | ||
| 127 | --> LuaSocket 2.0 | ||
| 128 | </pre> | ||
| 129 | |||
| 130 | <!-- tcp ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | 109 | <!-- tcp ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> |
| 131 | 110 | ||
| 132 | <h3 id=tcp>TCP</h3> | 111 | <h3 id=tcp>TCP</h3> |
| @@ -318,6 +297,17 @@ io.write(socket.try((udp:receive()))) | |||
| 318 | </pre> | 297 | </pre> |
| 319 | </blockquote> | 298 | </blockquote> |
| 320 | 299 | ||
| 300 | <!-- More +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | ||
| 301 | |||
| 302 | <h3 id=more>Much more</h3> | ||
| 303 | |||
| 304 | <p> LuaSocket offers much more than TCP and UDP support. As the library | ||
| 305 | 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 | href=url.html>URLs</a> and much more was made available.</a> These are | ||
| 308 | mostly implemented in Lua itself, with critical parts implemented in C for | ||
| 309 | efficiency</p> | ||
| 310 | |||
| 321 | <!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | 311 | <!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> |
| 322 | 312 | ||
| 323 | <div class=footer> | 313 | <div class=footer> |
| @@ -326,6 +316,7 @@ io.write(socket.try((udp:receive()))) | |||
| 326 | <p class=bar> | 316 | <p class=bar> |
| 327 | <a href="home.html">home</a> · | 317 | <a href="home.html">home</a> · |
| 328 | <a href="home.html#down">download</a> · | 318 | <a href="home.html#down">download</a> · |
| 319 | <a href="instalation.html">instalation</a> · | ||
| 329 | <a href="introduction.html">introduction</a> · | 320 | <a href="introduction.html">introduction</a> · |
| 330 | <a href="reference.html">reference</a> | 321 | <a href="reference.html">reference</a> |
| 331 | </p> | 322 | </p> |
