aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2004-05-25 06:52:06 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2004-05-25 06:52:06 +0000
commit4b7c2db4b7109bf57abd1b76abf24eba27f51aa1 (patch)
treeeade1b8e3a7337f6330c81252217090444c8314f
parentc53dad98839f5139dcedc128d2545dd2542a7157 (diff)
downloadluasocket-4b7c2db4b7109bf57abd1b76abf24eba27f51aa1.tar.gz
luasocket-4b7c2db4b7109bf57abd1b76abf24eba27f51aa1.tar.bz2
luasocket-4b7c2db4b7109bf57abd1b76abf24eba27f51aa1.zip
Forgot this file.
-rw-r--r--doc/socket.html135
1 files changed, 135 insertions, 0 deletions
diff --git a/doc/socket.html b/doc/socket.html
new file mode 100644
index 0000000..9372648
--- /dev/null
+++ b/doc/socket.html
@@ -0,0 +1,135 @@
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> &middot;
26<a href="home.html#download">download</a> &middot;
27<a href="introduction.html">introduction</a> &middot;
28<a href="reference.html">reference</a>
29</p>
30</center>
31<hr>
32</div>
33
34<!-- socket +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
35
36<h2 id=socket>The LuaSocket namespace</h2>
37
38<p>
39The <tt>socket</tt> namespace contains the namespace tables for all
40LuaSocket modules as well as function that didn't belong in any specific
41module, functions that are so commonly used that deserve a shortcut and a
42few constants.
43</p>
44
45<!-- debug ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
46
47<p class=name id=debug>
48socket.<b>debug</b>
49</p>
50
51<p class=description>
52This constant is set to <tt><b>true</b></tt> if the library was compiled
53with debug support.
54</p>
55
56
57<!-- protect +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
58
59<p class=name id=protect>
60socket.<b>protect(</b>function<b>)</b>
61</p>
62
63<p class=description>
64Converts a function that throws exceptions into a safe function.
65</p>
66
67<p class=parameters>
68<tt>Function</tt> is a function that calls
69<a href=#try><tt>try</tt></a> to throw exceptions.
70</p>
71
72<p class=return>
73The function an equivalent function that instead of throwing exceptoins,
74returns <tt><b>nil</b></tt> followed by an error message.
75</p>
76
77<!-- toip +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
78
79<p class=name id=try>
80socket.<b>try(</b>ret<sub>1</sub>, ret<sub>2</sub> ... ret<sub>N</sub><b>)</b>
81</p>
82
83<p class=description>
84Throws an exception in case of error.
85</p>
86
87<p class=parameters>
88</b>Ret<sub>1</sub>, ret<sub>2</sub> ... ret<sub>N</sub> can be arbitrary
89arguments, but are usually the return values of a function call that
90nested with the call to <tt>try</tt>.
91</p>
92
93<p class=return>
94The function returns ret<sub>1</sub>, ret<sub>2</sub> ... ret<sub>N</sub> if
95ret<sub>1</sub> is not <tt><b>nil</b></tt>. Otherwise, calls <tt>error</tt>
96passing ret<sub>2</sub>.
97</p>
98
99<pre class=example>
100-- connects or throws an exception with the appropriate error message
101c = socket.try(socket.connect("localhost", 80))
102</pre>
103
104<!-- version ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
105
106<p class=name id=version>
107socket.<b>version</b>
108</p>
109
110<p class=description>
111This constant has a string describing the current LuaSocket version.
112</p>
113
114<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
115
116<div class=footer>
117<hr>
118<center>
119<p class=bar>
120<a href="home.html">home</a> &middot;
121<a href="home.html#down">download</a> &middot;
122<a href="introduction.html">introduction</a> &middot;
123<a href="reference.html">reference</a>
124</p>
125<p>
126<small>
127Last modified by Diego Nehab on <br>
128Sat Aug 9 01:00:41 PDT 2003
129</small>
130</p>
131</center>
132</div>
133
134</body>
135</html>