Simplified use for sock:send.

This commit is contained in:
Diego Nehab 2005-01-27 21:30:01 +00:00
parent 2cd2a5d4a4
commit c5fefd5529
3 changed files with 16 additions and 3 deletions

3
FIX
View File

@ -1 +1,2 @@
tcp:shutdown() was checking for group instead of class.
tcp{client}:shutdown() was checking for group instead of class.
tcp{client}:send() now returns i+sent-1...

12
TODO
View File

@ -1,3 +1,15 @@
think about a dispatcher.
- it creates a server and receives a function that will do the work on
received connections
- this function is invoked with the client socket
- it calls special send and receive functions that yield on timeout
think about how to extend http, ftp, smtp to use special send and receive
functions for non-blocking so they can be used in the context of the
dispatcher!
adjust manual for new sock:send returns.
check all "require("http")" etc in the manual.
_VERSION, _DEBUG, etc.
get rid of "base." kludge

View File

@ -90,9 +90,9 @@ int buf_meth_send(lua_State *L, p_buf buf) {
if (err != IO_DONE) {
lua_pushnil(L);
lua_pushstring(L, buf->io->error(buf->io->ctx, err));
lua_pushnumber(L, sent);
lua_pushnumber(L, sent+start-1);
} else {
lua_pushnumber(L, sent);
lua_pushnumber(L, sent+start-1);
lua_pushnil(L);
lua_pushnil(L);
}