diff options
Diffstat (limited to 'NEW')
-rw-r--r-- | NEW | 101 |
1 files changed, 79 insertions, 22 deletions
@@ -1,29 +1,86 @@ | |||
1 | Major C code rewrite. Code is modular and extensible. Hopefully, next | 1 | What's New |
2 | versions will include code for local domain sockets, file descriptors, | ||
3 | pipes (on unix) and named pipes (on windows) as a bonus. | ||
4 | 2 | ||
5 | All functions provided by the library are in the namespace "socket". | 3 | Everything is new! Many changes for 2.0 happened in the C layer, |
6 | Functions such as send/receive/timeout/close etc do not exist anymore as | 4 | which has been almost completely rewritten. The code has been ported to |
7 | stand alone functions. They are now only available as methods of the | 5 | Lua 5.0 and greatly improved. There have also been some API changes |
8 | appropriate objects. | 6 | that made the interface simpler and more consistent. Here are some of |
7 | the changes that made it into version 2.0: | ||
9 | 8 | ||
10 | TCP has been changed to become more uniform. First create an object, then | 9 | <> Major C code rewrite. Code is modular and extensible. Hopefully, other |
11 | connect 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 | ||
15 | All functions return a non-nil value as first return value if successful. | 13 | <> Everything that is exported by the library is exported inside |
16 | All functions return whatever could be retrieved followed by error message | 14 | namespaces. These should be obtained with calls to the |
17 | in case of error. The best way to check for errors is to check for the | 15 | 'require' function; |
18 | presence of an error message. WARNING: The send function was affected. | ||
19 | 16 | ||
20 | Better 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 | ||
22 | UDP connected udp sockets can break association with peer by calling | 22 | <> All functions return a non-nil value as first return value if successful. |
23 | setpeername 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 | ||
25 | socket.sleep and socket.time are now part of the library and are | 26 | <> Greatly reduced the number of times the C select is called |
26 | supported. | 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 | |||
67 | Lots 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 | ||
28 | Socket options interface has been improved and TCP now also supports socket | ||
29 | options. | ||