Skip to content

Example Lua bindings for Enet using luajit2 ffi.

Notifications You must be signed in to change notification settings

chino/lua-ffi-enet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example Lua bindings for Enet using luajit2 ffi.

luajit2 ffi makes using C from Lua super easy.

It can parse header files and auto generate bindings.

In this example everything in enet.h is loaded into the enet name space.

A small convenience wrapper is also provided.

Note:

The enet.h header was generated by running it through cpp.

libenet.so was built by modifying Enet's automake files.

Simple chat interface using the bindings:

# host an enet session on port 2300 and wait for clients
./test.lua localhost 2300

# in another console
# using source port 2301 connect to the host on 2300
./test.lua localhost 2301 localhost 2300

About

Example Lua bindings for Enet using luajit2 ffi.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published