aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2003-06-30 18:53:10 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2003-06-30 18:53:10 +0000
commita581d2333be87796e2758806d38880e3e2be8a78 (patch)
treeb790421957baf22e41d962a31ca92aed2e6201ae
parent167727be3cefb3f45a26b0b1d96dc94a900a84b4 (diff)
downloadluasocket-a581d2333be87796e2758806d38880e3e2be8a78.tar.gz
luasocket-a581d2333be87796e2758806d38880e3e2be8a78.tar.bz2
luasocket-a581d2333be87796e2758806d38880e3e2be8a78.zip
Releasing 2.0 alpha!!!
-rw-r--r--NEW23
-rw-r--r--README9
-rw-r--r--TODO4
-rw-r--r--makefile.dist78
-rw-r--r--test/testclnt.lua32
5 files changed, 72 insertions, 74 deletions
diff --git a/NEW b/NEW
index e5efc97..34eac97 100644
--- a/NEW
+++ b/NEW
@@ -1,17 +1,21 @@
1Major C code rewrite. Code is modular and extensible. Hopefully, next
2versions will include code for local domain sockets, file descriptors,
3pipes (on unix) and named pipes (on windows) as a bonus.
4
1All functions provided by the library are in the namespace "socket". 5All functions provided by the library are in the namespace "socket".
2Functions such as send/receive/timeout/close etc do not exist in the 6Functions such as send/receive/timeout/close etc do not exist anymore as
3namespace. They are now only available as methods of the appropriate 7stand alone functions. They are now only available as methods of the
4objects. 8appropriate objects.
5 9
6Object has been changed to become more uniform. First create an object for 10TCP has been changed to become more uniform. First create an object, then
7a given domain/family and protocol. Then connect or bind if needed. Then 11connect or bind if needed. Then use IO functions. The "socket.connect" and
8use 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
10All functions return a non-nil value as first return value if successful. 15All functions return a non-nil value as first return value if successful.
11All functions return whatever could be retrieved followed by error message 16All functions return whatever could be retrieved followed by error message
12in case of error. The best way to check for errors is to check for the 17in case of error. The best way to check for errors is to check for the
13presence of an error message. 18presence of an error message. WARNING: The send function was affected.
14WARNING: The send function was affected.
15 19
16Better error messages and parameter checking. 20Better error messages and parameter checking.
17 21
@@ -20,3 +24,6 @@ setpeername with address "*".
20 24
21socket.sleep and socket.time are now part of the library and are 25socket.sleep and socket.time are now part of the library and are
22supported. 26supported.
27
28Socket options interface has been improved and TCP now also supports socket
29options.
diff --git a/README b/README
index 091ce6f..611d2a2 100644
--- a/README
+++ b/README
@@ -1,12 +1,9 @@
1This release is work in progress. It has been tested on WinXP, Mac OS X, 1This release is work in progress. It has been tested on WinXP, Mac OS X,
2SunOS and Linux. The most important change is a major rewrite of the C code 2SunOS and Linux.
3that attempts to make the library extensible. Also, all functions were
4moved to the 'socket' namespace. A few changes are expected for the final
5version, mostly in order to make the API more uniform.
6 3
7In this version, all Lua code has been built into the binary. For that, you 4In this version, all Lua code should be built into the binary. For that, you
8will need a working versions of luac and bin2c, both available with your 5will need a working versions of luac and bin2c, both available with your
9Lua distribution. Check makefile for details. 6Lua distribution. Check the makefile for details.
10 7
11Have fun, 8Have fun,
12Diego Nehab. 9Diego Nehab.
diff --git a/TODO b/TODO
index 5c2492d..ffc1ab0 100644
--- a/TODO
+++ b/TODO
@@ -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 @@
5DIST = luasocket-2.0-alpha 5DIST = luasocket-2.0-alpha
6 6
7LUA = \ 7LUA = \
8auxiliar.lua 8 auxiliar.lua \
9code.lua 9 code.lua \
10concat.lua 10 concat.lua \
11ftp.lua 11 ftp.lua \
12 http.lua \
13 select.lua \
14 smtp.lua \
15 url.lua
12 16
13TESTS = \ 17TESTS = \
14codetest.lua 18 codetest.lua \
15concattest.lua 19 concattest.lua \
16ftptest.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
18EXAMPLES = \ 30EXAMPLES = \
19check-links.lua 31 daytimeclnt.lua \
20daytimeclnt.lua 32 echoclnt.lua \
21echoclnt.lua 33 echosrvr.lua \
22echosrvr.lua 34 dict.lua \
23dict.lua 35 listener.lua \
36 talker.lua \
37 tinyirc.lua
24 38
25ETC = \ 39ETC = \
26cl-compat.lua 40 check-links.lua \
41 cl-compat.lua \
42 get.lua \
43 lua.lua \
44 luasocket.lua \
45 tftp.lua \
27 46
28get.lua
29http.lua
30httptest.lua
31listener.lua
32lua.lua
33luasocket.lua
34mbox.lua
35noglobals.lua
36select.lua
37smtp.lua
38smtptest.lua
39talker.lua
40testclnt.lua
41test.lua
42testsrvr.lua
43tftp.lua
44tinyirc.lua
45udptest.lua
46url.lua
47urltest.lua
48 47
49MAIN = \ 48MAIN = \
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
78dist: 75dist:
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()"
162end 164end
163 165
164 166
165--test_mixed(1) 167test_mixed(1)
166--test_mixed(17) 168test_mixed(17)
167--test_mixed(200) 169test_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
175test_mixed(4091)
176test_mixed(4091)
177test_mixed(4091)
178test_mixed(4091) 170test_mixed(4091)
171test_mixed(80199)
179test_mixed(4091) 172test_mixed(4091)
173test_mixed(200)
174test_mixed(17)
175test_mixed(1)
176
180------------------------------------------------------------------------ 177------------------------------------------------------------------------
181test("character line") 178test("character line")
182reconnect() 179reconnect()
@@ -203,6 +200,11 @@ test_asciiline(200)
203test_asciiline(4091) 200test_asciiline(4091)
204test_asciiline(80199) 201test_asciiline(80199)
205test_asciiline(800000) 202test_asciiline(800000)
203test_asciiline(80199)
204test_asciiline(4091)
205test_asciiline(200)
206test_asciiline(17)
207test_asciiline(1)
206 208
207------------------------------------------------------------------------ 209------------------------------------------------------------------------
208test("binary line") 210test("binary line")
@@ -479,9 +481,7 @@ function test_selectbugs()
479 pass("invalid input: ok") 481 pass("invalid input: ok")
480end 482end
481 483
482-- test_selectbugs() 484test_selectbugs()
483
484
485 485
486 486
487test(string.format("done in %.2fs", socket.time() - start)) 487test(string.format("done in %.2fs", socket.time() - start))