Skip to content


Subversion checkout URL

You can clone with
Download ZIP
A low-level network IO library.
C Lua
Branch: master

Merge pull request #1 from moteus/master

Fix. compile lsockaddr.c and lsocket.c on MSVC 10
latest commit 1d08c51010
@Neopallium authored
Failed to load latest commit information.
rockspecs Fix rockspec.
tests Use structure instead of plain fd for socket object.
CMakeLists.txt Add LAddrInfo for resolving hostnames.
config.h.cmake Initial minimally working version.
llnet.nobj.lua Use structure instead of plain fd for socket object.


travis-ci status

A low-level network/socket library.

TCP Tunning

When running the client/server examples with a larger number of concurrent connections or with keep-alive disabled make sure to tune your system to get good results.


# somaxconn needs to be larger then the listen backlog value used by the server.
# (see note below about listen backlog).
echo 65536 > /proc/sys/net/core/somaxconn
# These are useful when stress testing/benchmarking where a large number of connections
# will be opened & closed quickly.
echo 1 >/proc/sys/net/ipv4/tcp_tw_recycle
echo 1 >/proc/sys/net/ipv4/tcp_tw_reuse
echo 10 >/proc/sys/net/ipv4/tcp_fin_timeout
# increase client-side port range, not needed on server.
echo 1024 65535 > /proc/sys/net/ipv4/ip_local_port_range
# If you have iptables setup with the connection tracking (nf_conntrack) module enabled
# then also increase these values
echo 262144 >/proc/sys/net/netfilter/nf_conntrack_max
echo 32768 >/sys/module/nf_conntrack/parameters/hashsize

Note about listen backlog

If the backlog value passed to listen() is greater then the value in /proc/sys/net/core/somaxconn it will be silenty truncated to some very small value. This goes against what the man-page for listen() says:

If    the   backlog   argument   is   greater   than   the   value   in
/proc/sys/net/core/somaxconn, then it is  silently  truncated  to  that
value;  the  default  value  in  this  file  is 128.  In kernels before
2.4.25, this limit was a hard coded value, SOMAXCONN,  with  the  value


Lastest Git Revision

With CMake:

$ git clone git://
$ cd lua-llnet ; mkdir build ; cd build
$ cmake ..
$ make
$ sudo make install

Example usage

See the files under the examples/ folder

Something went wrong with that request. Please try again.