A Lua module that exposes the socket99 C library in Lua, making it easier to create TCP/UDP/Unix Domain client and server sockets.
$ luarocks install luasock99
local sock99 = require 'sock99'. You can check out the tests for actual examples of using the API.
Open the socket as configured by table t, which may have the following fields:
It returns the file descriptor (integer) on success, or
nil followed by a system-specific error message and error code on error. The file descriptor can be used with the standard POSIX calls (e.g. with
Note that this is a raw integer, as such it cannot install a garbage collector finalizer to close itself - it must be closed explicitly.
TODO: for Lua 5.4, set a metatable with
Clone the project and install the required development dependencies:
If like me you prefer to keep your dependencies locally, per-project, then I recommend using my llrocks wrapper of the
luarocks cli, which by default uses a local
$ llrocks install ...
To run tests:
$ llrocks run test/*.lua
The BSD 3-clause license for the Lua module. For the
socket99 C library, see the