In pre release mode!
This commit is contained in:
parent
f20f4889bf
commit
5e09779c7f
13 changed files with 279 additions and 407 deletions
|
@ -209,11 +209,16 @@ Here are a few examples with the simple interface:
|
|||
|
||||
<pre class=example>
|
||||
-- load the http module
|
||||
http = require("socket.http")
|
||||
local io = require("io")
|
||||
local http = require("socket.http")
|
||||
local ltn12 = require("ltn12")
|
||||
|
||||
-- connect to server "www.tecgraf.puc-rio.br" and retrieves this manual
|
||||
-- file from "/luasocket/http.html"
|
||||
b = http.request("http://www.tecgraf.puc-rio.br/luasocket/http.html")
|
||||
-- connect to server "www.cs.princeton.edu" and retrieves this manual
|
||||
-- file from "~diego/professional/luasocket/http.html" and print it to stdout
|
||||
http.request{
|
||||
url = "http://www.cs.princeton.edu/~diego/professional/luasocket/http.html",
|
||||
sink = ltn12.sink.file(io.stdout)
|
||||
}
|
||||
|
||||
-- connect to server "www.example.com" and tries to retrieve
|
||||
-- "/private/index.html". Fails because authentication is needed.
|
||||
|
|
|
@ -165,6 +165,13 @@ support.
|
|||
</p>
|
||||
|
||||
<ul>
|
||||
<li> New: sample module <tt>dispatch.lua</tt> implements a
|
||||
coroutine based dispatcher;
|
||||
<li> New: sample <tt>check-links.lua</tt> works
|
||||
both in blocking and non-blocking mode using coroutines
|
||||
(using the new dispatcher);
|
||||
<li> New: sample <tt>forward.lua</tt> implements a coroutine
|
||||
based forward server (using the new dispatcher);
|
||||
<li> Improved: <tt>tcp:send(data, i, j)</tt> to return <tt>(i+sent-1)</tt>. This is great for non-blocking I/O, but might break some code;
|
||||
<li> Improved: HTTP, SMTP, and FTP functions to accept a new field
|
||||
<tt>create</tt> that overrides the function used to create socket objects;
|
||||
|
|
|
@ -76,9 +76,9 @@ distribution directory structure:</p>
|
|||
<pre class=example>
|
||||
<SHARE>/compat-5.1.lua
|
||||
<SHARE>/ltn12.lua
|
||||
<SHARE>/mime/init.lua (originally mime.lua)
|
||||
<SHARE>/mime/mime.lua
|
||||
<LIB>/mime/core.dll
|
||||
<SHARE>/socket/init.lua (originally socket.lua)
|
||||
<SHARE>/socket/socket.lua
|
||||
<LIB>/socket/core.dll
|
||||
<SHARE>/socket/http.lua
|
||||
<SHARE>/socket/tp.lua
|
||||
|
@ -88,9 +88,7 @@ distribution directory structure:</p>
|
|||
</pre>
|
||||
|
||||
<p> Naturally, on Unix systems, <tt>core.dll</tt>
|
||||
would be replaced by <tt>core.so</tt>. Notice that in the instalation,
|
||||
<tt>socket.lua</tt> becomes <tt>socket/init.lua</tt>, and the same happens
|
||||
with <tt>mime.lua</tt>, which becomes <tt>mime/init.lua</tt>.
|
||||
would be replaced by <tt>core.so</tt>.
|
||||
</p>
|
||||
|
||||
<p> In order for the interpreter to find all LuaSocket components, three
|
||||
|
|
|
@ -446,6 +446,7 @@ The method returns 1 in case of success and <tt><b>nil</b></tt> otherwise.
|
|||
<!-- settimeout +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
||||
|
||||
<p class=name id=settimeout>
|
||||
master:<b>settimeout(</b>value [, mode]<b>)</b><br>
|
||||
client:<b>settimeout(</b>value [, mode]<b>)</b><br>
|
||||
server:<b>settimeout(</b>value [, mode]<b>)</b>
|
||||
</p>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue