Network support for the Lua language
socket.tcp can accept fd and socket type ('master'(default), 'client') acceptfd method can be used to write multi-threaded server. ```lua -- main thread local fd = srv_sock:acceptfd() Threads.runfile('echo.lua', fd) -- echo.lua local fd = ... local sock = socket.tcp(fd,'client') ``` or to interact with library such as [ESL](http://wiki.freeswitch.org/wiki/Event_Socket_Library) ```lua local fd = srv_sock:acceptfd() Threads.runfile('worker.lua', fd) -- worker.lua local sock = ESLconnection((...)) ``` If we need just close fd (for example we can not run worker thread) we should call `socket.tcp(fd,'client'):close()` |
||
---|---|---|
doc | ||
etc | ||
gem | ||
samples | ||
src | ||
test | ||
.gitignore | ||
FIX | ||
LICENSE | ||
linux.cmd | ||
logo.ps | ||
ltn012.wiki | ||
ltn013.wiki | ||
Lua51.props | ||
Lua52.props | ||
luasocket-2.1-1.rockspec | ||
luasocket.sln | ||
macosx.cmd | ||
makefile | ||
makefile.dist | ||
mime.vcxproj | ||
mime.vcxproj.filters | ||
mingw.cmd | ||
NEW | ||
README | ||
socket.vcxproj | ||
socket.vcxproj.filters | ||
TODO | ||
win32.cmd | ||
WISH |
This is the LuaSocket 2.1. It has been tested on --[[WinXP--]], Mac OS X, and --[[Linux--]]. Please use the Lua mailing list to report any bugs (or "features") you encounter. Have fun, Diego Nehab.