- Implemented in pure Lua: works with 5.4
The stream.lua
file should be download into an package.path
directory and required by it:
local stream = require('stream')
The module provides the following functions:
Create and bind a Unix Domain Socket.
local sock = stream.unix('/tmp/unix.sock')
Wait for server connect and call callback when accepted.
function accept(sock)
-- Some processing.
end
stream.accept(sock, accept)
stream.serve()
This module is free software; you can redistribute it and/or modify it under the terms of the MIT license. See LICENSE for details.