lua-users home
lua-l archive

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


Joseph Stewart wrote:
All,

Maybe I don't understand the underlying problem the acceptfd patch
addresses, but if it's simply a matter of getting the file descriptor
from a luasocket object, then you can use the :getfd() function.


Quoting from:
http://www.net-core.org/39/lua/patching-luasocket-to-make-it-compatible

"It adds a new method “acceptfd” which works just like “accept” but instead of returning a socket object it returns the underlying “file descriptor” (a number). A new optional parameter to “socket.tcp()” allows to create a socket object from a file descriptor."

So you could accept connections in a given Lua state and process it in a different one. Be it by means of using Lanes, LuaProc, or whatever suits you.

Regards,
Ignacio