aboutsummaryrefslogtreecommitdiff
path: root/NEW
diff options
context:
space:
mode:
Diffstat (limited to 'NEW')
-rw-r--r--NEW101
1 files changed, 79 insertions, 22 deletions
diff --git a/NEW b/NEW
index 34eac97..035aab7 100644
--- a/NEW
+++ b/NEW
@@ -1,29 +1,86 @@
1Major C code rewrite. Code is modular and extensible. Hopefully, next 1What's New
2versions will include code for local domain sockets, file descriptors,
3pipes (on unix) and named pipes (on windows) as a bonus.
4 2
5All functions provided by the library are in the namespace "socket". 3Everything is new! Many changes for 2.0 happened in the C layer,
6Functions such as send/receive/timeout/close etc do not exist anymore as 4which has been almost completely rewritten. The code has been ported to
7stand alone functions. They are now only available as methods of the 5Lua 5.0 and greatly improved. There have also been some API changes
8appropriate objects. 6that made the interface simpler and more consistent. Here are some of
7the changes that made it into version 2.0:
9 8
10TCP has been changed to become more uniform. First create an object, then 9<> Major C code rewrite. Code is modular and extensible. Hopefully, other
11connect or bind if needed. Then use IO functions. The "socket.connect" and 10 developers will be motivated to provide code for SSL, local domain
12"socket.bind" functions are provided for simplicity, but they just call 11 sockets, file descriptors, pipes (on Unix) and named pipes etc;
13"socket.tcp" followed by the ":connect" or ":bind" methods.
14 12
15All functions return a non-nil value as first return value if successful. 13<> Everything that is exported by the library is exported inside
16All functions return whatever could be retrieved followed by error message 14 namespaces. These should be obtained with calls to the
17in case of error. The best way to check for errors is to check for the 15 'require' function;
18presence of an error message. WARNING: The send function was affected.
19 16
20Better error messages and parameter checking. 17<> Functions such as
18 send/receive/timeout/close etc do not exist anymore as stand-alone
19 functions. They are now only available as methods of the appropriate
20 objects;
21 21
22UDP connected udp sockets can break association with peer by calling 22<> All functions return a non-nil value as first return value if successful.
23setpeername with address "*". 23 All functions return 'nil' followed by error message
24 in case of error. This made the library much easier to use;
24 25
25socket.sleep and socket.time are now part of the library and are 26<> Greatly reduced the number of times the C select is called
26supported. 27 during data transfers, by calling only on failure. This might
28 improve a lot the maximum throughput;
29
30<> TCP has been changed to become more uniform. It's possible to first
31 create a TCP object,
32 then connect or bind if needed, and finally use I/O functions.
33 'socket.connect' and 'socket.bind' functions are still
34 provided for simplicity;
35
36<> This allows for setting a timeout value before connecting;
37
38<> And also allows binding to a local address before connecting;
39
40<> New 'socket.dns.gethostname' function and 'shutdown'
41 method;
42
43<> Better error messages and parameter checking;
44
45<> Should be interrupt safe;
46
47<> UDP connected sockets can break association with peer by calling
48 'setpeername' with address ''*'';
49
50<> Sets returned by 'socket.select' are associative;
51
52<> Select checks if sockets have buffered data and returns immediately;
53
54<> 'socket.sleep' and 'socket.time' are now part of the
55 library and are supported. They used to be available only when
56 LUASOCKET_DEBUG was defined, but it turns out they might be useful for
57 applications;
58
59<> 'socket.try' and 'socket.protect' provide a simple
60 interface to exceptions that proved very in the implementation of
61 high-level modules;
62
63<> Socket options interface has been improved. TCP objects also
64 support socket options and many new options were added.
65
66
67Lots of changes in the Lua modules, too!
68
69<> Every module loads only the modules that it needs. There is no waste
70 of memory. LuaSocket core takes only 20k of memory;
71
72<> New MIME and LTN12 modules make all other modules much more powerful;
73
74<> Support for multipart messages in the SMTP module;
75
76<> The old callback mechanism of FTP and HTTP has been replaced with LTN12
77 sources and sinks, with advantage;
78
79<> Common implementation for low-level FTP and SMTP;
80
81<> FTP, HTTP, and SMTP are implemented in multiple levels in such a way
82 that users will have no problems extending the functionality to satisfy
83 personal needs;
84
85<> SMTP knows how to perform LOGIN and PLAIN authentication.
27 86
28Socket options interface has been improved and TCP now also supports socket
29options.