diff options
author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2005-11-20 08:56:19 +0000 |
---|---|---|
committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2005-11-20 08:56:19 +0000 |
commit | 5e09779c7f6b1710150d5a0f12d86ded7ede75c6 (patch) | |
tree | ffd2e2e7d918cc30015c89bd14122aa8cadb1546 /etc | |
parent | f20f4889bfe5a02cd9b77868b90cc8042352176a (diff) | |
download | luasocket-5e09779c7f6b1710150d5a0f12d86ded7ede75c6.tar.gz luasocket-5e09779c7f6b1710150d5a0f12d86ded7ede75c6.tar.bz2 luasocket-5e09779c7f6b1710150d5a0f12d86ded7ede75c6.zip |
In pre release mode!
Diffstat (limited to 'etc')
-rw-r--r-- | etc/README | 93 | ||||
-rw-r--r-- | etc/check-memory.lua | 2 |
2 files changed, 68 insertions, 27 deletions
@@ -1,48 +1,89 @@ | |||
1 | This directory contains code that is more useful than the examples. This code | 1 | This directory contains code that is more useful than the |
2 | *is* supported. | 2 | samples. This code *is* supported. |
3 | 3 | ||
4 | tftp.lua -- Trivial FTP client | 4 | tftp.lua -- Trivial FTP client |
5 | 5 | ||
6 | This module implements file retrieval by the TFTP protocol. Its main use | 6 | This module implements file retrieval by the TFTP protocol. |
7 | was to test the UDP code, but since someone found it usefull, I turned it | 7 | Its main use was to test the UDP code, but since someone |
8 | into a module that is almost official (no uploads, yet). | 8 | found it usefull, I turned it into a module that is almost |
9 | official (no uploads, yet). | ||
9 | 10 | ||
10 | dict.lua -- Dict client | 11 | dict.lua -- Dict client |
11 | 12 | ||
12 | The dict.lua module started with a cool simple client for the DICT | 13 | The dict.lua module started with a cool simple client |
13 | protocol, written by Luiz Henrique Figueiredo. This new version has been | 14 | for the DICT protocol, written by Luiz Henrique Figueiredo. |
14 | converted into a library, similar to the HTTP and FTP libraries, that can | 15 | This new version has been converted into a library, similar |
15 | be used from within any luasocket application. Take a look on the source | 16 | to the HTTP and FTP libraries, that can be used from within |
16 | code and you will be able to figure out how to use it. | 17 | any luasocket application. Take a look on the source code |
18 | and you will be able to figure out how to use it. | ||
17 | 19 | ||
18 | lp.lua -- LPD client | 20 | lp.lua -- LPD client library |
19 | 21 | ||
20 | The lp.lua module implements the client part of the Line Printer Daemon | 22 | The lp.lua module implements the client part of the Line |
21 | protocol, used to print files on Unix machines. It is courtesy of David | 23 | Printer Daemon protocol, used to print files on Unix |
22 | Burgess and I heard he would be the one supporting it, even after I messed | 24 | machines. It is courtesy of David Burgess! See the source |
23 | with it. See the source code and the lpr.lua in the examples directory. | 25 | code and the lpr.lua in the examples directory. |
26 | |||
27 | b64.lua | ||
28 | qp.lua | ||
29 | eol.lua | ||
30 | |||
31 | These are tiny programs that perform Base64, | ||
32 | Quoted-Printable and end-of-line marker conversions. | ||
24 | 33 | ||
25 | get.lua -- file retriever | 34 | get.lua -- file retriever |
26 | 35 | ||
27 | This little program is a client that uses the FTP and HTTP code to | 36 | This little program is a client that uses the FTP and |
28 | implement a command line file graber. Just run | 37 | HTTP code to implement a command line file graber. Just |
38 | run | ||
29 | 39 | ||
30 | lua get.lua <remote-file> [<local-file>] | 40 | lua get.lua <remote-file> [<local-file>] |
31 | 41 | ||
32 | to download a remote file (either ftp:// or http://) to the specified | 42 | to download a remote file (either ftp:// or http://) to |
33 | local file. The program also prints the download throughput, elapsed | 43 | the specified local file. The program also prints the |
34 | time, bytes already downloaded etc during download. | 44 | download throughput, elapsed time, bytes already downloaded |
45 | etc during download. | ||
46 | |||
47 | check-memory.lua -- checks memory consumption | ||
48 | |||
49 | This is just to see how much memory each module uses. | ||
50 | |||
51 | dispatch.lua -- coroutine based dispatcher | ||
52 | |||
53 | This is a first try at a coroutine based non-blocking | ||
54 | dispatcher for LuaSocket. Take a look at 'check-links.lua' | ||
55 | and at 'forward.lua' to see how to use it. | ||
35 | 56 | ||
36 | check-links.lua -- HTML link checker program | 57 | check-links.lua -- HTML link checker program |
37 | 58 | ||
38 | This little program scans a HTML file and checks for broken links. It is | 59 | This little program scans a HTML file and checks for broken |
39 | similar to check-links.pl by Jamie Zawinski, but uses all facilities of | 60 | links. It is similar to check-links.pl by Jamie Zawinski, |
40 | the LuaSocket library and the Lua language. It has not been thoroughly | 61 | but uses all facilities of the LuaSocket library and the Lua |
41 | tested, but it should work. Just run | 62 | language. It has not been thoroughly tested, but it should |
63 | work. Just run | ||
64 | |||
65 | lua check-links.lua [-n] {<url>} > output | ||
66 | |||
67 | and open the result to see a list of broken links. You can | ||
68 | also use the '-n' switch to run the same program in | ||
69 | non-blocking mode to see how much faster things can get. | ||
70 | |||
71 | forward.lua -- coroutine based forward server | ||
72 | |||
73 | This is a forward server that can accept several connections | ||
74 | and transfers simultaneously using non-blocking I/O and the | ||
75 | coroutine-based dispatcher. You can run, for example | ||
76 | |||
77 | lua forward.lua 8080:proxy.com:3128 | ||
78 | |||
79 | to redirect all local conections to port 8080 to the host | ||
80 | 'proxy.com' at port 3128. | ||
42 | 81 | ||
43 | lua check-links.lua {<url>} > output | 82 | unix.c and unix.h |
44 | 83 | ||
45 | and open the result to see a list of broken links. | 84 | This is an implementation of Unix local domain sockets and |
85 | demonstrates how to extend LuaSocket with a new type of | ||
86 | transport. It has been tested on Linux and on Mac OS X. | ||
46 | 87 | ||
47 | Good luck, | 88 | Good luck, |
48 | Diego. | 89 | Diego. |
diff --git a/etc/check-memory.lua b/etc/check-memory.lua index 7bcdf67..7bd984d 100644 --- a/etc/check-memory.lua +++ b/etc/check-memory.lua | |||
@@ -7,7 +7,7 @@ function load(s) | |||
7 | print(s .. ":\t " .. (b-a) .. "k") | 7 | print(s .. ":\t " .. (b-a) .. "k") |
8 | end | 8 | end |
9 | 9 | ||
10 | load("url") | 10 | load("socket.url") |
11 | load("ltn12") | 11 | load("ltn12") |
12 | load("socket") | 12 | load("socket") |
13 | load("mime") | 13 | load("mime") |