aboutsummaryrefslogtreecommitdiff
path: root/doc/introduction.html
diff options
context:
space:
mode:
Diffstat (limited to 'doc/introduction.html')
-rw-r--r--doc/introduction.html39
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,
8Library, 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> &middot; 28<a href="home.html">home</a> &middot;
28<a href="home.html#download">download</a> &middot; 29<a href="home.html#download">download</a> &middot;
30<a href="instalation.html">instalation</a> &middot;
29<a href="introduction.html">introduction</a> &middot; 31<a href="introduction.html">introduction</a> &middot;
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
104than it is in C, as the following sections will show. 106than 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>
112The core LuaSocket is almost entirely implemented in C. It is
113usually available as a dynamic library which the interpreter can load
114with the help of a loader module written in Lua.
115Beginning with version 2.0 and following the Lua 5.0 trend, all LuaSocket
116functionality is defined inside tables (or rather namespaces). No global
117variables are ever created.
118Namespaces are obtained with the <tt>require</tt> Lua function, which loads
119and initializes any required library and returns the namespace.
120For example, the core functionality or LuaSocket is usually available
121from the "<tt>socket</tt>" namespace.
122</p>
123
124<pre class="example">
125socket = require("socket")
126print(socket.VERSION)
127--&gt; 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
305evolved, 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
307href=url.html>URLs</a> and much more was made available.</a> These are
308mostly implemented in Lua itself, with critical parts implemented in C for
309efficiency</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> &middot; 317<a href="home.html">home</a> &middot;
328<a href="home.html#down">download</a> &middot; 318<a href="home.html#down">download</a> &middot;
319<a href="instalation.html">instalation</a> &middot;
329<a href="introduction.html">introduction</a> &middot; 320<a href="introduction.html">introduction</a> &middot;
330<a href="reference.html">reference</a> 321<a href="reference.html">reference</a>
331</p> 322</p>