diff options
| author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2003-06-30 18:53:10 +0000 |
|---|---|---|
| committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2003-06-30 18:53:10 +0000 |
| commit | a581d2333be87796e2758806d38880e3e2be8a78 (patch) | |
| tree | b790421957baf22e41d962a31ca92aed2e6201ae | |
| parent | 167727be3cefb3f45a26b0b1d96dc94a900a84b4 (diff) | |
| download | luasocket-a581d2333be87796e2758806d38880e3e2be8a78.tar.gz luasocket-a581d2333be87796e2758806d38880e3e2be8a78.tar.bz2 luasocket-a581d2333be87796e2758806d38880e3e2be8a78.zip | |
Releasing 2.0 alpha!!!
| -rw-r--r-- | NEW | 23 | ||||
| -rw-r--r-- | README | 9 | ||||
| -rw-r--r-- | TODO | 4 | ||||
| -rw-r--r-- | makefile.dist | 78 | ||||
| -rw-r--r-- | test/testclnt.lua | 32 |
5 files changed, 72 insertions, 74 deletions
| @@ -1,17 +1,21 @@ | |||
| 1 | Major C code rewrite. Code is modular and extensible. Hopefully, next | ||
| 2 | versions will include code for local domain sockets, file descriptors, | ||
| 3 | pipes (on unix) and named pipes (on windows) as a bonus. | ||
| 4 | |||
| 1 | All functions provided by the library are in the namespace "socket". | 5 | All functions provided by the library are in the namespace "socket". |
| 2 | Functions such as send/receive/timeout/close etc do not exist in the | 6 | Functions such as send/receive/timeout/close etc do not exist anymore as |
| 3 | namespace. They are now only available as methods of the appropriate | 7 | stand alone functions. They are now only available as methods of the |
| 4 | objects. | 8 | appropriate objects. |
| 5 | 9 | ||
| 6 | Object has been changed to become more uniform. First create an object for | 10 | TCP has been changed to become more uniform. First create an object, then |
| 7 | a given domain/family and protocol. Then connect or bind if needed. Then | 11 | connect or bind if needed. Then use IO functions. The "socket.connect" and |
| 8 | use IO functions. | 12 | "socket.bind" functions are provided for simplicity, but they just call |
| 13 | "socket.tcp" followed by the ":connect" or ":bind" methods. | ||
| 9 | 14 | ||
| 10 | All functions return a non-nil value as first return value if successful. | 15 | All functions return a non-nil value as first return value if successful. |
| 11 | All functions return whatever could be retrieved followed by error message | 16 | All functions return whatever could be retrieved followed by error message |
| 12 | in case of error. The best way to check for errors is to check for the | 17 | in case of error. The best way to check for errors is to check for the |
| 13 | presence of an error message. | 18 | presence of an error message. WARNING: The send function was affected. |
| 14 | WARNING: The send function was affected. | ||
| 15 | 19 | ||
| 16 | Better error messages and parameter checking. | 20 | Better error messages and parameter checking. |
| 17 | 21 | ||
| @@ -20,3 +24,6 @@ setpeername with address "*". | |||
| 20 | 24 | ||
| 21 | socket.sleep and socket.time are now part of the library and are | 25 | socket.sleep and socket.time are now part of the library and are |
| 22 | supported. | 26 | supported. |
| 27 | |||
| 28 | Socket options interface has been improved and TCP now also supports socket | ||
| 29 | options. | ||
| @@ -1,12 +1,9 @@ | |||
| 1 | This release is work in progress. It has been tested on WinXP, Mac OS X, | 1 | This release is work in progress. It has been tested on WinXP, Mac OS X, |
| 2 | SunOS and Linux. The most important change is a major rewrite of the C code | 2 | SunOS and Linux. |
| 3 | that attempts to make the library extensible. Also, all functions were | ||
| 4 | moved to the 'socket' namespace. A few changes are expected for the final | ||
| 5 | version, mostly in order to make the API more uniform. | ||
| 6 | 3 | ||
| 7 | In this version, all Lua code has been built into the binary. For that, you | 4 | In this version, all Lua code should be built into the binary. For that, you |
| 8 | will need a working versions of luac and bin2c, both available with your | 5 | will need a working versions of luac and bin2c, both available with your |
| 9 | Lua distribution. Check makefile for details. | 6 | Lua distribution. Check the makefile for details. |
| 10 | 7 | ||
| 11 | Have fun, | 8 | Have fun, |
| 12 | Diego Nehab. | 9 | Diego Nehab. |
| @@ -1,8 +1,4 @@ | |||
| 1 | - Melhorar a interface de setoptions (aceitar nada como true, por exemplo) | 1 | - Melhorar a interface de setoptions (aceitar nada como true, por exemplo) |
| 2 | - Inicializaccao das classes pode falhar? | ||
| 3 | - Ajeitar melhor a hierarquia de classes. Ajeitar o file... | ||
| 4 | - GARBAGE COLLECTOR! | ||
| 5 | - Adicionar um método sock:setoption??? | ||
| 6 | - testar em várias plataformas | 2 | - testar em várias plataformas |
| 7 | - adicionar exemplos de expansão: pipe, local, named pipe | 3 | - adicionar exemplos de expansão: pipe, local, named pipe |
| 8 | 4 | ||
diff --git a/makefile.dist b/makefile.dist index 9cf2757..353467b 100644 --- a/makefile.dist +++ b/makefile.dist | |||
| @@ -5,46 +5,45 @@ | |||
| 5 | DIST = luasocket-2.0-alpha | 5 | DIST = luasocket-2.0-alpha |
| 6 | 6 | ||
| 7 | LUA = \ | 7 | LUA = \ |
| 8 | auxiliar.lua | 8 | auxiliar.lua \ |
| 9 | code.lua | 9 | code.lua \ |
| 10 | concat.lua | 10 | concat.lua \ |
| 11 | ftp.lua | 11 | ftp.lua \ |
| 12 | http.lua \ | ||
| 13 | select.lua \ | ||
| 14 | smtp.lua \ | ||
| 15 | url.lua | ||
| 12 | 16 | ||
| 13 | TESTS = \ | 17 | TESTS = \ |
| 14 | codetest.lua | 18 | codetest.lua \ |
| 15 | concattest.lua | 19 | concattest.lua \ |
| 16 | ftptest.lua | 20 | ftptest.lua \ |
| 21 | mbox.lua \ | ||
| 22 | httptest.lua \ | ||
| 23 | noglobals.lua \ | ||
| 24 | smtptest.lua \ | ||
| 25 | testclnt.lua \ | ||
| 26 | testsrvr.lua \ | ||
| 27 | udptest.lua \ | ||
| 28 | urltest.lua | ||
| 17 | 29 | ||
| 18 | EXAMPLES = \ | 30 | EXAMPLES = \ |
| 19 | check-links.lua | 31 | daytimeclnt.lua \ |
| 20 | daytimeclnt.lua | 32 | echoclnt.lua \ |
| 21 | echoclnt.lua | 33 | echosrvr.lua \ |
| 22 | echosrvr.lua | 34 | dict.lua \ |
| 23 | dict.lua | 35 | listener.lua \ |
| 36 | talker.lua \ | ||
| 37 | tinyirc.lua | ||
| 24 | 38 | ||
| 25 | ETC = \ | 39 | ETC = \ |
| 26 | cl-compat.lua | 40 | check-links.lua \ |
| 41 | cl-compat.lua \ | ||
| 42 | get.lua \ | ||
| 43 | lua.lua \ | ||
| 44 | luasocket.lua \ | ||
| 45 | tftp.lua \ | ||
| 27 | 46 | ||
| 28 | get.lua | ||
| 29 | http.lua | ||
| 30 | httptest.lua | ||
| 31 | listener.lua | ||
| 32 | lua.lua | ||
| 33 | luasocket.lua | ||
| 34 | mbox.lua | ||
| 35 | noglobals.lua | ||
| 36 | select.lua | ||
| 37 | smtp.lua | ||
| 38 | smtptest.lua | ||
| 39 | talker.lua | ||
| 40 | testclnt.lua | ||
| 41 | test.lua | ||
| 42 | testsrvr.lua | ||
| 43 | tftp.lua | ||
| 44 | tinyirc.lua | ||
| 45 | udptest.lua | ||
| 46 | url.lua | ||
| 47 | urltest.lua | ||
| 48 | 47 | ||
| 49 | MAIN = \ | 48 | MAIN = \ |
| 50 | auxiliar.c \ | 49 | auxiliar.c \ |
| @@ -57,10 +56,8 @@ MAIN = \ | |||
| 57 | inet.h \ | 56 | inet.h \ |
| 58 | io.c \ | 57 | io.c \ |
| 59 | io.h \ | 58 | io.h \ |
| 60 | lua.c \ | ||
| 61 | luasocket.c \ | 59 | luasocket.c \ |
| 62 | luasocket.h \ | 60 | luasocket.h \ |
| 63 | makefile \ | ||
| 64 | select.c \ | 61 | select.c \ |
| 65 | select.h \ | 62 | select.h \ |
| 66 | socket.h \ | 63 | socket.h \ |
| @@ -73,23 +70,24 @@ MAIN = \ | |||
| 73 | usocket.c \ | 70 | usocket.c \ |
| 74 | usocket.h \ | 71 | usocket.h \ |
| 75 | wsocket.c \ | 72 | wsocket.c \ |
| 76 | wsocket.h \ | 73 | wsocket.h |
| 77 | 74 | ||
| 78 | dist: | 75 | dist: |
| 79 | mkdir -p $(DIST)/examples | 76 | mkdir -p $(DIST)/examples |
| 80 | mkdir -p $(DIST)/tests | 77 | mkdir -p $(DIST)/tests |
| 81 | mkdir -p $(DIST)/etc | 78 | mkdir -p $(DIST)/etc |
| 82 | mkdir -p $(DIST)/lua | ||
| 83 | cp -vf $(MAIN) $(DIST) | 79 | cp -vf $(MAIN) $(DIST) |
| 84 | cp -vf $(LUA) $(DIST) | 80 | cp -vf $(LUA) $(DIST) |
| 85 | cp -vf makefile $(DIST) | 81 | cp -vf makefile $(DIST) |
| 86 | cp -vf README $(DIST) | 82 | cp -vf README $(DIST) |
| 83 | cp -vf lua.README $(DIST) | ||
| 84 | cp -vf NEW $(DIST) | ||
| 87 | cp -vf $(EXAMPLES) $(DIST)/examples | 85 | cp -vf $(EXAMPLES) $(DIST)/examples |
| 88 | cp -vf README.examples $(DIST)/examples/README | 86 | cp -vf examples.README $(DIST)/examples/README |
| 89 | cp -vf $(TESTS) $(DIST)/tests | 87 | cp -vf $(TESTS) $(DIST)/tests |
| 90 | cp -vf README.tests $(DIST)/tests/README | 88 | cp -vf tests.README $(DIST)/tests/README |
| 91 | cp -vf $(ETC) $(DIST)/etc | 89 | cp -vf $(ETC) $(DIST)/etc |
| 92 | cp -vf README.etc $(DIST)/etc/README | 90 | cp -vf etc.README $(DIST)/etc/README |
| 93 | tar -zcvf $(DIST).tar.gz $(DIST) | 91 | tar -zcvf $(DIST).tar.gz $(DIST) |
| 94 | zip -r $(DIST).zip $(DIST) | 92 | zip -r $(DIST).zip $(DIST) |
| 95 | 93 | ||
diff --git a/test/testclnt.lua b/test/testclnt.lua index 20ef0b6..b58ca2b 100644 --- a/test/testclnt.lua +++ b/test/testclnt.lua | |||
| @@ -120,6 +120,7 @@ test_methods(socket.tcp(), { | |||
| 120 | "setsockname", | 120 | "setsockname", |
| 121 | "getpeername", | 121 | "getpeername", |
| 122 | "getsockname", | 122 | "getsockname", |
| 123 | "setoption", | ||
| 123 | "timeout", | 124 | "timeout", |
| 124 | "close", | 125 | "close", |
| 125 | }) | 126 | }) |
| @@ -133,6 +134,7 @@ test_methods(socket.udp(), { | |||
| 133 | "sendto", | 134 | "sendto", |
| 134 | "receive", | 135 | "receive", |
| 135 | "receivefrom", | 136 | "receivefrom", |
| 137 | "setoption", | ||
| 136 | "timeout", | 138 | "timeout", |
| 137 | "close", | 139 | "close", |
| 138 | }) | 140 | }) |
| @@ -162,21 +164,16 @@ remote "data:send(str); data:close()" | |||
| 162 | end | 164 | end |
| 163 | 165 | ||
| 164 | 166 | ||
| 165 | --test_mixed(1) | 167 | test_mixed(1) |
| 166 | --test_mixed(17) | 168 | test_mixed(17) |
| 167 | --test_mixed(200) | 169 | test_mixed(200) |
| 168 | --test_mixed(4091) | ||
| 169 | --test_mixed(80199) | ||
| 170 | --test_mixed(4091) | ||
| 171 | --test_mixed(200) | ||
| 172 | --test_mixed(17) | ||
| 173 | --test_mixed(1) | ||
| 174 | |||
| 175 | test_mixed(4091) | ||
| 176 | test_mixed(4091) | ||
| 177 | test_mixed(4091) | ||
| 178 | test_mixed(4091) | 170 | test_mixed(4091) |
| 171 | test_mixed(80199) | ||
| 179 | test_mixed(4091) | 172 | test_mixed(4091) |
| 173 | test_mixed(200) | ||
| 174 | test_mixed(17) | ||
| 175 | test_mixed(1) | ||
| 176 | |||
| 180 | ------------------------------------------------------------------------ | 177 | ------------------------------------------------------------------------ |
| 181 | test("character line") | 178 | test("character line") |
| 182 | reconnect() | 179 | reconnect() |
| @@ -203,6 +200,11 @@ test_asciiline(200) | |||
| 203 | test_asciiline(4091) | 200 | test_asciiline(4091) |
| 204 | test_asciiline(80199) | 201 | test_asciiline(80199) |
| 205 | test_asciiline(800000) | 202 | test_asciiline(800000) |
| 203 | test_asciiline(80199) | ||
| 204 | test_asciiline(4091) | ||
| 205 | test_asciiline(200) | ||
| 206 | test_asciiline(17) | ||
| 207 | test_asciiline(1) | ||
| 206 | 208 | ||
| 207 | ------------------------------------------------------------------------ | 209 | ------------------------------------------------------------------------ |
| 208 | test("binary line") | 210 | test("binary line") |
| @@ -479,9 +481,7 @@ function test_selectbugs() | |||
| 479 | pass("invalid input: ok") | 481 | pass("invalid input: ok") |
| 480 | end | 482 | end |
| 481 | 483 | ||
| 482 | -- test_selectbugs() | 484 | test_selectbugs() |
| 483 | |||
| 484 | |||
| 485 | 485 | ||
| 486 | 486 | ||
| 487 | test(string.format("done in %.2fs", socket.time() - start)) | 487 | test(string.format("done in %.2fs", socket.time() - start)) |
