On Tue, Sep 25, 2012 at 8:17 AM, 丁树凯 <dingshu...
> These days I want to find a lua socket server as my next game's server.
> luvit is the one I find that is highly active.
> I think you guys are doing wonderful jobs.
Sorry there aren't more docs. Basically the luvit APIs in core match
what's in Node.JS core. The docs at nodejs.org will get you pretty
far. I hope to find time to fix this soon.
As far as socket.io, realize that socket.io is a high-level
abstraction over multiple transports (including websockets). The
luvit net module is for basic TCP sockets which are much lower level.
Do you need a duplex (web)socket with the browser, or are just looking
for API examples for a TCP socket?
> 2. How to handle with connection broken and reconnect?
> mobile games' networks are not as stable as PC.
> connection broken and reconnect are common. They need taken care.
> but I don't know how to do it.
Yes, I believe there are events emitted when the connection dies. The
unit tests should have some examples, I haven't used the net module
much at all, so I can't speak much for it.
> 3. Does it use epoll under linux?
> My lua server will run under linux. I hope it has high performance in net
> AFAIK, epoll is the best choise under linux to implement async io.
> I don't know what lib luvit uses.
Yes, luvit uses libuv which currently uses libev on linux which uses
epoll. libuv uses the best system interface for each platform (IOCP
on windows, kqueue on darwin, epoll on linux...)
> Thank you! you guys rock!
No problem, we've had fun hacking on this. Sorry it's not better
supported. Mostly it's been a hobby of mine and used in production by
a team at Rackspace that already knew both Lua and the Node.JS API.
If anyone else is using luvit seriously, I'd love to hear about it.