lua-socket: unix domain sockets?

I’m using lua-socket 3.0rc1.3 (that comes with Ubuntu Trusty) and lua 5.1. I’m trying to listen on a unix domain socket, and the only example code I can find is this

-- send stdin through unix socket
socket = require"socket"
socket.unix = require"socket.unix"
c = assert(socket.unix())
while 1 do
    local l =
    assert(c:send(l .. "n"))

Problem is, when I try and connect() I get “no such file or directory” – how do I create that socket in the first place? mkfifo /tmp/foo which someone recommended me gets me a “connection refused” error instead (I don’t think a fifo is the same thing as a domain socket?).

Is there any minimal working example out there of using luasocket on a unix domain socket?

Source: unix

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.