Either I'm overtired or blind. I want to learn networking with Lua and therefore I have to install the socket
lib, so I can require it easily, but I don't know, which files I should "require". The example says:
local socket = require("socket")
but as I said, I don't know which files I should include, if I use socket.lua
it doesn't work and I get: No files found
.
I got the lib from here: Lua socket download
Or, is there another way to install the socket lib?
LuaSocket is a Lua extension library composed of two parts: a set of C modules that provide support for the TCP and UDP transport layers, and. a set of Lua modules that provide functions commonly needed by applications that deal with the Internet.
To install Luarocks, you first need to install Lua. On Windows and Mac, you can download and install Lua from the website. Once Lua is installed, install Luarocks. If you're on Linux, the luarocks command is available in your distribution's repository.
use this command on your linux system :
#luarocks install luasocket
the use the next command to see the paths CONFIGURATION
#luarocks
You need to use default linux account (see: CONFIGURATION) :
$lua
> socket = require ("socket")
or use this:
> socket = require 'socket'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With