lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


There are a few efforts going on to port nodeJS to lua.

 - http://github.com/creationix/luvit/ - My project.  Not done, but does have working tcp socket and some http support already.  I'm using the same core libraries as latest node. (libuv, http_parser, c-ares, etc...)
 - https://github.com/ignacio/luanode - A farther along project using Boost.asio for it's networking.
 - https://github.com/bnoordhuis/lua-uv - new project aiming to bind libuv as a standalone lua module that can be used with stock lua

On Fri, Sep 30, 2011 at 7:47 AM, Ivoszz <ivoszz@gmail.com> wrote:
Maybe using lua-zmq can help you, if you don't need plain sockets. Look also at lua-handlers on github.

ivoszz


2011/9/30 Xavier Wang <weasley.wx@gmail.com>
Hi dear list,

I'm thinking about net game programming in Lua, I have used luasocket
before, but it blocking in sending/receiving, I have a question, are
there callback based socket interface in Lua? e.g.

local s = socket.connect("www.google.com", 80)
s:send("GET /\r\n", function(e, chunk)
   print(e, chunk)
end)

that is to register a callback to interface, and when the send/receive
finished, the callback will called by interface.

Are there anyone have the same idea or some experience? Thank you :-)