diff options
author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-06-20 22:19:54 +0000 |
---|---|---|
committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-06-20 22:19:54 +0000 |
commit | f7579db9e830ef41f422a280d26c9077f48728e5 (patch) | |
tree | d96affac7f5e8203d2e9c4a053213a992cd76650 /doc | |
parent | 5dc5c3ebe8f111bba01762ca0f5edba912c4f0b9 (diff) | |
download | luasocket-f7579db9e830ef41f422a280d26c9077f48728e5.tar.gz luasocket-f7579db9e830ef41f422a280d26c9077f48728e5.tar.bz2 luasocket-f7579db9e830ef41f422a280d26c9077f48728e5.zip |
Fixing bugs...
Diffstat (limited to 'doc')
-rw-r--r-- | doc/dns.html | 2 | ||||
-rw-r--r-- | doc/ftp.html | 18 | ||||
-rw-r--r-- | doc/http.html | 18 | ||||
-rw-r--r-- | doc/index.html | 6 | ||||
-rw-r--r-- | doc/introduction.html | 2 | ||||
-rw-r--r-- | doc/ltn12.html | 2 | ||||
-rw-r--r-- | doc/mime.html | 2 | ||||
-rw-r--r-- | doc/reference.css | 2 | ||||
-rw-r--r-- | doc/reference.html | 4 | ||||
-rw-r--r-- | doc/smtp.html | 28 | ||||
-rw-r--r-- | doc/socket.html | 31 | ||||
-rw-r--r-- | doc/tcp.html | 8 | ||||
-rw-r--r-- | doc/udp.html | 2 | ||||
-rw-r--r-- | doc/url.html | 8 |
14 files changed, 78 insertions, 55 deletions
diff --git a/doc/dns.html b/doc/dns.html index 67b24ca..47134d8 100644 --- a/doc/dns.html +++ b/doc/dns.html | |||
@@ -16,7 +16,7 @@ | |||
16 | <center> | 16 | <center> |
17 | <table summary="LuaSocket logo"> | 17 | <table summary="LuaSocket logo"> |
18 | <tr><td align=center><a href="http://www.lua.org"> | 18 | <tr><td align=center><a href="http://www.lua.org"> |
19 | <img border=0 alt="LuaSocket" src="luasocket.png"> | 19 | <img width=128 border=0 alt="LuaSocket" src="luasocket.png"> |
20 | </a></td></tr> | 20 | </a></td></tr> |
21 | <tr><td align=center valign=top>Network support for the Lua language | 21 | <tr><td align=center valign=top>Network support for the Lua language |
22 | </td></tr> | 22 | </td></tr> |
diff --git a/doc/ftp.html b/doc/ftp.html index 14a3601..fe514e9 100644 --- a/doc/ftp.html +++ b/doc/ftp.html | |||
@@ -14,7 +14,7 @@ | |||
14 | <center> | 14 | <center> |
15 | <table summary="LuaSocket logo"> | 15 | <table summary="LuaSocket logo"> |
16 | <tr><td align=center><a href="http://www.lua.org"> | 16 | <tr><td align=center><a href="http://www.lua.org"> |
17 | <img border=0 alt="LuaSocket" src="luasocket.png"> | 17 | <img width=128 border=0 alt="LuaSocket" src="luasocket.png"> |
18 | </a></td></tr> | 18 | </a></td></tr> |
19 | <tr><td align=center valign=top>Network support for the Lua language | 19 | <tr><td align=center valign=top>Network support for the Lua language |
20 | </td></tr> | 20 | </td></tr> |
@@ -227,10 +227,10 @@ message describing the reason for failure. | |||
227 | -- load the ftp support | 227 | -- load the ftp support |
228 | local ftp = require("ftp") | 228 | local ftp = require("ftp") |
229 | 229 | ||
230 | -- Log as user "diego" on server "ftp.tecgraf.puc-rio.br", | 230 | -- Log as user "fulano" on server "ftp.example.com", |
231 | -- using password "nehab", and store a file "README" with contents | 231 | -- using password "silva", and store a file "README" with contents |
232 | -- "wrong password, of course" | 232 | -- "wrong password, of course" |
233 | f, e = ftp.put("ftp://diego:nehab@ftp.tecgraf.puc-rio.br/README", | 233 | f, e = ftp.put("ftp://fulano:silva@ftp.example.com/README", |
234 | "wrong password, of course") | 234 | "wrong password, of course") |
235 | </pre> | 235 | </pre> |
236 | 236 | ||
@@ -239,13 +239,13 @@ f, e = ftp.put("ftp://diego:nehab@ftp.tecgraf.puc-rio.br/README", | |||
239 | local ftp = require("ftp") | 239 | local ftp = require("ftp") |
240 | local ltn12 = require("ltn12") | 240 | local ltn12 = require("ltn12") |
241 | 241 | ||
242 | -- Log as user "diego" on server "ftp.tecgraf.puc-rio.br", | 242 | -- Log as user "fulano" on server "ftp.example.com", |
243 | -- using password "nehab", and append to the remote file "LOG", sending the | 243 | -- using password "silva", and append to the remote file "LOG", sending the |
244 | -- contents of the local file "LOCAL-LOG" | 244 | -- contents of the local file "LOCAL-LOG" |
245 | f, e = ftp.put{ | 245 | f, e = ftp.put{ |
246 | host = "ftp.tecgraf.puc-rio.br", | 246 | host = "ftp.example.com", |
247 | user = "diego", | 247 | user = "fulano", |
248 | password = "nehab", | 248 | password = "silva", |
249 | command = "appe", | 249 | command = "appe", |
250 | argument = "LOG", | 250 | argument = "LOG", |
251 | source = ltn12.source.file(io.open("LOCAL-LOG", "r")) | 251 | source = ltn12.source.file(io.open("LOCAL-LOG", "r")) |
diff --git a/doc/http.html b/doc/http.html index a98915c..4780436 100644 --- a/doc/http.html +++ b/doc/http.html | |||
@@ -16,7 +16,7 @@ | |||
16 | <center> | 16 | <center> |
17 | <table summary="LuaSocket logo"> | 17 | <table summary="LuaSocket logo"> |
18 | <tr><td align=center><a href="http://www.lua.org"> | 18 | <tr><td align=center><a href="http://www.lua.org"> |
19 | <img border=0 alt="LuaSocket" src="luasocket.png"> | 19 | <img width=128 border=0 alt="LuaSocket" src="luasocket.png"> |
20 | </a></td></tr> | 20 | </a></td></tr> |
21 | <tr><td align=center valign=top>Network support for the Lua language | 21 | <tr><td align=center valign=top>Network support for the Lua language |
22 | </td></tr> | 22 | </td></tr> |
@@ -209,9 +209,9 @@ http = require("http") | |||
209 | -- file from "/luasocket/http.html" | 209 | -- file from "/luasocket/http.html" |
210 | b = http.request("http://www.tecgraf.puc-rio.br/luasocket/http.html") | 210 | b = http.request("http://www.tecgraf.puc-rio.br/luasocket/http.html") |
211 | 211 | ||
212 | -- connect to server "www.tecgraf.puc-rio.br" and tries to retrieve | 212 | -- connect to server "www.example.com" and tries to retrieve |
213 | -- "~diego/auth/index.html". Fails because authentication is needed. | 213 | -- "/private/index.html". Fails because authentication is needed. |
214 | b, c, h = http.request("http://www.tecgraf.puc-rio.br/~diego/auth/index.html") | 214 | b, c, h = http.request("http://www.example.com/private/index.html") |
215 | -- b returns some useless page telling about the denied access, | 215 | -- b returns some useless page telling about the denied access, |
216 | -- h returns authentication information | 216 | -- h returns authentication information |
217 | -- and c returns with value 401 (Authentication Required) | 217 | -- and c returns with value 401 (Authentication Required) |
@@ -276,16 +276,16 @@ authentication is required. | |||
276 | http = require("http") | 276 | http = require("http") |
277 | mime = require("mime") | 277 | mime = require("mime") |
278 | 278 | ||
279 | -- Connect to server "www.tecgraf.puc-rio.br" and tries to retrieve | 279 | -- Connect to server "www.example.com" and tries to retrieve |
280 | -- "~diego/auth/index.html", using the provided name and password to | 280 | -- "/private/index.html", using the provided name and password to |
281 | -- authenticate the request | 281 | -- authenticate the request |
282 | b, c, h = http.request("http://diego:password@www.tecgraf.puc-rio.br/~diego/auth/index.html") | 282 | b, c, h = http.request("http://fulano:silva@www.example.com/private/index.html") |
283 | 283 | ||
284 | -- Alternatively, one could fill the appropriate header and authenticate | 284 | -- Alternatively, one could fill the appropriate header and authenticate |
285 | -- the request directly. | 285 | -- the request directly. |
286 | r, c = http.request { | 286 | r, c = http.request { |
287 | url = "http://www.tecgraf.puc-rio.br/~diego/auth/index.html", | 287 | url = "http://www.example.com/private/index.html", |
288 | headers = { authentication = "Basic " .. (mime.b64("diego:password")) } | 288 | headers = { authentication = "Basic " .. (mime.b64("fulano:silva")) } |
289 | } | 289 | } |
290 | </pre> | 290 | </pre> |
291 | 291 | ||
diff --git a/doc/index.html b/doc/index.html index 7394386..0e9eb1d 100644 --- a/doc/index.html +++ b/doc/index.html | |||
@@ -16,7 +16,7 @@ | |||
16 | <center> | 16 | <center> |
17 | <table summary="LuaSocket logo"> | 17 | <table summary="LuaSocket logo"> |
18 | <tr><td align=center><a href="http://www.lua.org"> | 18 | <tr><td align=center><a href="http://www.lua.org"> |
19 | <img border=0 alt="LuaSocket" src="luasocket.png"> | 19 | <img width=128 border=0 alt="LuaSocket" src="luasocket.png"> |
20 | </a></td></tr> | 20 | </a></td></tr> |
21 | <tr><td align=center valign=top>Network support for the Lua language | 21 | <tr><td align=center valign=top>Network support for the Lua language |
22 | </td></tr> | 22 | </td></tr> |
@@ -216,7 +216,7 @@ the changes that made it into version 2.0: | |||
216 | 216 | ||
217 | <li> Select checks if sockets have buffered data and returns immediately; | 217 | <li> Select checks if sockets have buffered data and returns immediately; |
218 | 218 | ||
219 | <li> <tt>socket.sleep</tt> and <tt>socket.time</tt> are now part of the | 219 | <li> <tt>socket.sleep</tt> and <tt>socket.gettime</tt> are now part of the |
220 | library and are supported. They used to be available only when | 220 | library and are supported. They used to be available only when |
221 | LUASOCKET_DEBUG was defined, but it turns out they might be useful for | 221 | LUASOCKET_DEBUG was defined, but it turns out they might be useful for |
222 | applications; | 222 | applications; |
@@ -276,6 +276,8 @@ return convention WILL break old code; | |||
276 | does not call <tt>listen</tt> anymore. It is the new <tt>listen</tt> | 276 | does not call <tt>listen</tt> anymore. It is the new <tt>listen</tt> |
277 | method that turns a TCP object into a server object; | 277 | method that turns a TCP object into a server object; |
278 | 278 | ||
279 | <li> <tt>socket.time</tt> became <tt>socket.gettime</tt> for uniformity; | ||
280 | |||
279 | <li> Interface to options has changed. | 281 | <li> Interface to options has changed. |
280 | 282 | ||
281 | </ul> | 283 | </ul> |
diff --git a/doc/introduction.html b/doc/introduction.html index 8706c83..2c738d6 100644 --- a/doc/introduction.html +++ b/doc/introduction.html | |||
@@ -16,7 +16,7 @@ | |||
16 | <center> | 16 | <center> |
17 | <table summary="LuaSocket logo"> | 17 | <table summary="LuaSocket logo"> |
18 | <tr><td align=center><a href="http://www.lua.org"> | 18 | <tr><td align=center><a href="http://www.lua.org"> |
19 | <img border=0 alt="LuaSocket" src="luasocket.png"> | 19 | <img width=128 border=0 alt="LuaSocket" src="luasocket.png"> |
20 | </a></td></tr> | 20 | </a></td></tr> |
21 | <tr><td align=center valign=top>Network support for the Lua language | 21 | <tr><td align=center valign=top>Network support for the Lua language |
22 | </td></tr> | 22 | </td></tr> |
diff --git a/doc/ltn12.html b/doc/ltn12.html index 23b9ff8..bfb9b51 100644 --- a/doc/ltn12.html +++ b/doc/ltn12.html | |||
@@ -16,7 +16,7 @@ | |||
16 | <center> | 16 | <center> |
17 | <table summary="LuaSocket logo"> | 17 | <table summary="LuaSocket logo"> |
18 | <tr><td align=center><a href="http://www.lua.org"> | 18 | <tr><td align=center><a href="http://www.lua.org"> |
19 | <img border=0 alt="LuaSocket" src="luasocket.png"> | 19 | <img width=128 border=0 alt="LuaSocket" src="luasocket.png"> |
20 | </a></td></tr> | 20 | </a></td></tr> |
21 | <tr><td align=center valign=top>Network support for the Lua language | 21 | <tr><td align=center valign=top>Network support for the Lua language |
22 | </td></tr> | 22 | </td></tr> |
diff --git a/doc/mime.html b/doc/mime.html index 520c8ff..0f4ffa8 100644 --- a/doc/mime.html +++ b/doc/mime.html | |||
@@ -16,7 +16,7 @@ | |||
16 | <center> | 16 | <center> |
17 | <table summary="LuaSocket logo"> | 17 | <table summary="LuaSocket logo"> |
18 | <tr><td align=center><a href="http://www.lua.org"> | 18 | <tr><td align=center><a href="http://www.lua.org"> |
19 | <img border=0 alt="LuaSocket" src="luasocket.png"> | 19 | <img width=128 border=0 alt="LuaSocket" src="luasocket.png"> |
20 | </a></td></tr> | 20 | </a></td></tr> |
21 | <tr><td align=center valign=top>Network support for the Lua language | 21 | <tr><td align=center valign=top>Network support for the Lua language |
22 | </td></tr> | 22 | </td></tr> |
diff --git a/doc/reference.css b/doc/reference.css index 7c8148d..b1dd25d 100644 --- a/doc/reference.css +++ b/doc/reference.css | |||
@@ -1,7 +1,7 @@ | |||
1 | body { | 1 | body { |
2 | margin-left: 1em; | 2 | margin-left: 1em; |
3 | margin-right: 1em; | 3 | margin-right: 1em; |
4 | font-family: "Verdana"; | 4 | font-family: "Verdana", sans-serif; |
5 | } | 5 | } |
6 | 6 | ||
7 | tt { | 7 | tt { |
diff --git a/doc/reference.html b/doc/reference.html index ec81d72..5c07c4d 100644 --- a/doc/reference.html +++ b/doc/reference.html | |||
@@ -16,7 +16,7 @@ | |||
16 | <center> | 16 | <center> |
17 | <table summary="LuaSocket logo"> | 17 | <table summary="LuaSocket logo"> |
18 | <tr><td align=center><a href="http://www.lua.org"> | 18 | <tr><td align=center><a href="http://www.lua.org"> |
19 | <img border=0 alt="LuaSocket" src="luasocket.png"> | 19 | <img width=128 border=0 alt="LuaSocket" src="luasocket.png"> |
20 | </a></td></tr> | 20 | </a></td></tr> |
21 | <tr><td align=center valign=top>Network support for the Lua language | 21 | <tr><td align=center valign=top>Network support for the Lua language |
22 | </td></tr> | 22 | </td></tr> |
@@ -140,6 +140,7 @@ | |||
140 | <blockquote> | 140 | <blockquote> |
141 | <a href="socket.html#debug">DEBUG</a>, | 141 | <a href="socket.html#debug">DEBUG</a>, |
142 | <a href="dns.html#dns">dns</a>, | 142 | <a href="dns.html#dns">dns</a>, |
143 | <a href="socket.html#gettime">gettime</a>, | ||
143 | <a href="socket.html#newtry">newtry</a>, | 144 | <a href="socket.html#newtry">newtry</a>, |
144 | <a href="socket.html#protect">protect</a>, | 145 | <a href="socket.html#protect">protect</a>, |
145 | <a href="socket.html#select">select</a>, | 146 | <a href="socket.html#select">select</a>, |
@@ -147,7 +148,6 @@ | |||
147 | <a href="socket.html#skip">skip</a>, | 148 | <a href="socket.html#skip">skip</a>, |
148 | <a href="socket.html#sleep">sleep</a>, | 149 | <a href="socket.html#sleep">sleep</a>, |
149 | <a href="socket.html#source">source</a>, | 150 | <a href="socket.html#source">source</a>, |
150 | <a href="socket.html#time">time</a>, | ||
151 | <a href="tcp.html#tcp">tcp</a>, | 151 | <a href="tcp.html#tcp">tcp</a>, |
152 | <a href="socket.html#try">try</a>, | 152 | <a href="socket.html#try">try</a>, |
153 | <a href="udp.html#udp">udp</a>, | 153 | <a href="udp.html#udp">udp</a>, |
diff --git a/doc/smtp.html b/doc/smtp.html index 89f4757..224dde3 100644 --- a/doc/smtp.html +++ b/doc/smtp.html | |||
@@ -16,7 +16,7 @@ | |||
16 | <center> | 16 | <center> |
17 | <table summary="LuaSocket logo"> | 17 | <table summary="LuaSocket logo"> |
18 | <tr><td align=center><a href="http://www.lua.org"> | 18 | <tr><td align=center><a href="http://www.lua.org"> |
19 | <img border=0 alt="LuaSocket" src="luasocket.png"> | 19 | <img width=128 border=0 alt="LuaSocket" src="luasocket.png"> |
20 | </a></td></tr> | 20 | </a></td></tr> |
21 | <tr><td align=center valign=top>Network support for the Lua language | 21 | <tr><td align=center valign=top>Network support for the Lua language |
22 | </td></tr> | 22 | </td></tr> |
@@ -165,7 +165,7 @@ If successful, the function returns 1. Otherwise, the function returns | |||
165 | <p class=note> | 165 | <p class=note> |
166 | Note: SMTP servers are can be very picky with the format of e-mail | 166 | Note: SMTP servers are can be very picky with the format of e-mail |
167 | addresses. To be safe, use only addresses of the form | 167 | addresses. To be safe, use only addresses of the form |
168 | "<tt><fulano@tecgraf.puc-rio.br></tt>" in the <tt>from</tt> and | 168 | "<tt><fulano@example.com></tt>" in the <tt>from</tt> and |
169 | <tt>rcpt</tt> arguments to the <tt>send</tt> function. In headers, e-mail | 169 | <tt>rcpt</tt> arguments to the <tt>send</tt> function. In headers, e-mail |
170 | addresses can take whatever form you like. </p> | 170 | addresses can take whatever form you like. </p> |
171 | 171 | ||
@@ -238,23 +238,23 @@ and | |||
238 | local smtp = require("smtp") | 238 | local smtp = require("smtp") |
239 | 239 | ||
240 | -- Connects to server "localhost" and sends a message to users | 240 | -- Connects to server "localhost" and sends a message to users |
241 | -- "fulano@tecgraf.puc-rio.br", "beltrano@tecgraf.puc-rio.br", | 241 | -- "fulano@example.com", "beltrano@example.com", |
242 | -- and "sicrano@tecgraf.puc-rio.br". | 242 | -- and "sicrano@example.com". |
243 | -- Note that "fulano" is the primary recipient, "beltrano" receives a | 243 | -- Note that "fulano" is the primary recipient, "beltrano" receives a |
244 | -- carbon copy and neither of them knows that "sicrano" received a blind | 244 | -- carbon copy and neither of them knows that "sicrano" received a blind |
245 | -- carbon copy of the message. | 245 | -- carbon copy of the message. |
246 | from = "<luasocket@tecgraf.puc-rio.br>" | 246 | from = "<luasocket@example.com>" |
247 | 247 | ||
248 | rcpt = { | 248 | rcpt = { |
249 | "<fulano@tecgraf.puc-rio.br>", | 249 | "<fulano@example.com>", |
250 | "<beltrano@tecgraf.puc-rio.br>", | 250 | "<beltrano@example.com>", |
251 | "<sicrano@tecgraf.puc-rio.br>" | 251 | "<sicrano@example.com>" |
252 | } | 252 | } |
253 | 253 | ||
254 | mesgt = { | 254 | mesgt = { |
255 | headers = { | 255 | headers = { |
256 | to = "Fulano da Silva <fulano@tecgraf.puc-rio.br>", | 256 | to = "Fulano da Silva <fulano@example.com>", |
257 | cc = '"Beltrano F. Nunes" <beltrano@tecgraf.puc-rio.br>', | 257 | cc = '"Beltrano F. Nunes" <beltrano@example.com>', |
258 | subject = "My first message" | 258 | subject = "My first message" |
259 | } | 259 | } |
260 | body = "I hope this works. If it does, I can send you another 1000 copies." | 260 | body = "I hope this works. If it does, I can send you another 1000 copies." |
@@ -334,8 +334,8 @@ local ltn12 = require("ltn12") | |||
334 | source = smtp.message{ | 334 | source = smtp.message{ |
335 | headers = { | 335 | headers = { |
336 | -- Remember that headers are *ignored* by smtp.send. | 336 | -- Remember that headers are *ignored* by smtp.send. |
337 | from = "Sicrano de Oliveira <sicrano@tecgraf.puc-rio.br>", | 337 | from = "Sicrano de Oliveira <sicrano@example.com>", |
338 | to = "Fulano da Silva <fulano@tecgraf.puc-rio.br>", | 338 | to = "Fulano da Silva <fulano@example.com>", |
339 | subject = "Here is a message with attachments" | 339 | subject = "Here is a message with attachments" |
340 | }, | 340 | }, |
341 | body = { | 341 | body = { |
@@ -378,8 +378,8 @@ source = smtp.message{ | |||
378 | 378 | ||
379 | -- finally send it | 379 | -- finally send it |
380 | r, e = smtp.send{ | 380 | r, e = smtp.send{ |
381 | from = "<sicrano@tecgraf.puc-rio.br>", | 381 | from = "<sicrano@example.com>", |
382 | rcpt = "<fulano@tecgraf.puc-rio.br>", | 382 | rcpt = "<fulano@example.com>", |
383 | source = source, | 383 | source = source, |
384 | } | 384 | } |
385 | </pre> | 385 | </pre> |
diff --git a/doc/socket.html b/doc/socket.html index 4d77478..1bbeb7f 100644 --- a/doc/socket.html +++ b/doc/socket.html | |||
@@ -16,7 +16,7 @@ | |||
16 | <center> | 16 | <center> |
17 | <table summary="LuaSocket logo"> | 17 | <table summary="LuaSocket logo"> |
18 | <tr><td align=center><a href="http://www.lua.org"> | 18 | <tr><td align=center><a href="http://www.lua.org"> |
19 | <img border=0 alt="LuaSocket" src="luasocket.png"> | 19 | <img width=128 border=0 alt="LuaSocket" src="luasocket.png"> |
20 | </a></td></tr> | 20 | </a></td></tr> |
21 | <tr><td align=center valign=top>Network support for the Lua language | 21 | <tr><td align=center valign=top>Network support for the Lua language |
22 | </td></tr> | 22 | </td></tr> |
@@ -48,6 +48,27 @@ To obtain the <tt>socket</tt> namespace, run: | |||
48 | local socket = require("socket") | 48 | local socket = require("socket") |
49 | </pre> | 49 | </pre> |
50 | 50 | ||
51 | <!-- bind ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | ||
52 | |||
53 | <p class=name id=bind> | ||
54 | socket.<b>bind(</b>address, port [, backlog]<b>)</b> | ||
55 | </p> | ||
56 | |||
57 | <p class=description> | ||
58 | </p> | ||
59 | |||
60 | <!-- connect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | ||
61 | |||
62 | <p class=name id=connect> | ||
63 | socket.<b>connect(</b>address, port [, locaddr, locport]<b>)</b> | ||
64 | </p> | ||
65 | |||
66 | <p class=description> | ||
67 | This function is a shortcut that creates and returns a TCP socket object | ||
68 | connected to a remote <tt>host</tt> at a given <tt>port</tt>. Optionally, | ||
69 | the use can also specify the local address and port to bind | ||
70 | (<tt>locaddr</tt> and </tt>locport</tt>). | ||
71 | </p> | ||
51 | 72 | ||
52 | <!-- debug ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | 73 | <!-- debug ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> |
53 | 74 | ||
@@ -289,8 +310,8 @@ The function returns a source with the appropriate behavior. | |||
289 | 310 | ||
290 | <!-- time ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | 311 | <!-- time ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> |
291 | 312 | ||
292 | <p class=name id=time> | 313 | <p class=name id=gettime> |
293 | socket.<b>time()</b> | 314 | socket.<b>gettime()</b> |
294 | </p> | 315 | </p> |
295 | 316 | ||
296 | <p class=description> | 317 | <p class=description> |
@@ -304,9 +325,9 @@ The function returns the time as a number. | |||
304 | </p> | 325 | </p> |
305 | 326 | ||
306 | <pre class=example> | 327 | <pre class=example> |
307 | t = socket.time() | 328 | t = socket.gettime() |
308 | -- do stuff | 329 | -- do stuff |
309 | print(socket.time() - t .. " seconds elapsed") | 330 | print(socket.gettime() - t .. " seconds elapsed") |
310 | </pre> | 331 | </pre> |
311 | 332 | ||
312 | <!-- try ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | 333 | <!-- try ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> |
diff --git a/doc/tcp.html b/doc/tcp.html index cd417a5..37b0b56 100644 --- a/doc/tcp.html +++ b/doc/tcp.html | |||
@@ -16,7 +16,7 @@ | |||
16 | <center> | 16 | <center> |
17 | <table summary="LuaSocket logo"> | 17 | <table summary="LuaSocket logo"> |
18 | <tr><td align=center><a href="http://www.lua.org"> | 18 | <tr><td align=center><a href="http://www.lua.org"> |
19 | <img border=0 alt="LuaSocket" src="luasocket.png"> | 19 | <img width=128 border=0 alt="LuaSocket" src="luasocket.png"> |
20 | </a></td></tr> | 20 | </a></td></tr> |
21 | <tr><td align=center valign=top>Network support for the Lua language | 21 | <tr><td align=center valign=top>Network support for the Lua language |
22 | </td></tr> | 22 | </td></tr> |
@@ -74,7 +74,7 @@ reported by <b><tt>nil</tt></b> followed by a message describing the error. | |||
74 | </p> | 74 | </p> |
75 | 75 | ||
76 | <p class=note> | 76 | <p class=note> |
77 | Note: calling <a href=misc.html#socket.select><tt>socket.select</tt></a> | 77 | Note: calling <a href=sockett.html#select><tt>socket.select</tt></a> |
78 | with a server object in | 78 | with a server object in |
79 | the <tt>receive</tt> parameter before a call to <tt>accept</tt> does | 79 | the <tt>receive</tt> parameter before a call to <tt>accept</tt> does |
80 | <em>not</em> guarantee <tt>accept</tt> will return immediately. Use the <a | 80 | <em>not</em> guarantee <tt>accept</tt> will return immediately. Use the <a |
@@ -94,7 +94,7 @@ local host. | |||
94 | 94 | ||
95 | <p class=parameters> | 95 | <p class=parameters> |
96 | <tt>Address</tt> can be an IP address or a host name. | 96 | <tt>Address</tt> can be an IP address or a host name. |
97 | <tt>Port</tt> must be an integer number in the range [0..64K]. | 97 | <tt>Port</tt> must be an integer number in the range [0..64K). |
98 | If <tt>address</tt> | 98 | If <tt>address</tt> |
99 | is '<tt>*</tt>', the system binds to all local interfaces | 99 | is '<tt>*</tt>', the system binds to all local interfaces |
100 | using the <tt>INADDR_ANY</tt> constant. If <tt>port</tt> is 0, the system automatically | 100 | using the <tt>INADDR_ANY</tt> constant. If <tt>port</tt> is 0, the system automatically |
@@ -154,7 +154,7 @@ and <a href=#close><tt>close</tt></a>. | |||
154 | 154 | ||
155 | <p class=parameters> | 155 | <p class=parameters> |
156 | <tt>Address</tt> can be an IP address or a host name. | 156 | <tt>Address</tt> can be an IP address or a host name. |
157 | <tt>Port</tt> must be an integer number in the range [1..64K]. | 157 | <tt>Port</tt> must be an integer number in the range [1..64K). |
158 | </p> | 158 | </p> |
159 | 159 | ||
160 | <p class=return> | 160 | <p class=return> |
diff --git a/doc/udp.html b/doc/udp.html index 6f2e607..69895ce 100644 --- a/doc/udp.html +++ b/doc/udp.html | |||
@@ -14,7 +14,7 @@ | |||
14 | <center> | 14 | <center> |
15 | <table summary="LuaSocket logo"> | 15 | <table summary="LuaSocket logo"> |
16 | <tr><td align=center><a href="http://www.lua.org"> | 16 | <tr><td align=center><a href="http://www.lua.org"> |
17 | <img border=0 alt="LuaSocket" src="luasocket.png"> | 17 | <img width=128 border=0 alt="LuaSocket" src="luasocket.png"> |
18 | </a></td></tr> | 18 | </a></td></tr> |
19 | <tr><td align=center valign=top>Network support for the Lua language | 19 | <tr><td align=center valign=top>Network support for the Lua language |
20 | </td></tr> | 20 | </td></tr> |
diff --git a/doc/url.html b/doc/url.html index 46e6e09..207995c 100644 --- a/doc/url.html +++ b/doc/url.html | |||
@@ -16,7 +16,7 @@ | |||
16 | <center> | 16 | <center> |
17 | <table summary="LuaSocket logo"> | 17 | <table summary="LuaSocket logo"> |
18 | <tr><td align=center><a href="http://www.lua.org"> | 18 | <tr><td align=center><a href="http://www.lua.org"> |
19 | <img border=0 alt="LuaSocket" src="luasocket.png"> | 19 | <img width=128 border=0 alt="LuaSocket" src="luasocket.png"> |
20 | </a></td></tr> | 20 | </a></td></tr> |
21 | <tr><td align=center valign=top>Network support for the Lua language | 21 | <tr><td align=center valign=top>Network support for the Lua language |
22 | </td></tr> | 22 | </td></tr> |
@@ -238,11 +238,11 @@ parsed_url = {<br> | |||
238 | -- load url module | 238 | -- load url module |
239 | url = require("url") | 239 | url = require("url") |
240 | 240 | ||
241 | parsed_url = url.parse("http://www.puc-rio.br/~diego/index.lua?a=2#there") | 241 | parsed_url = url.parse("http://www.example.com/cgilua/index.lua?a=2#there") |
242 | -- parsed_url = { | 242 | -- parsed_url = { |
243 | -- scheme = "http", | 243 | -- scheme = "http", |
244 | -- authority = "www.puc-rio.br", | 244 | -- authority = "www.example.com", |
245 | -- path = "/~diego/index.lua" | 245 | -- path = "/cgilua/index.lua" |
246 | -- query = "a=2", | 246 | -- query = "a=2", |
247 | -- fragment = "there", | 247 | -- fragment = "there", |
248 | -- host = "www.puc-rio.br", | 248 | -- host = "www.puc-rio.br", |