summaryrefslogtreecommitdiff
path: root/tests/test-uds-server.lua
blob: 5677f717495f04cef72083fba64134495990a7c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
-- See LICENSE file for copyright and license details.
l = require "luxio"

sock = l.socket(l.AF_UNIX, l.SOCK_DGRAM, 0)
sockaddr = l.make_sockaddr(l.AF_UNIX, "test-socket")
l.unlink "test-socket"
l.bind(sock, sockaddr)
l.listen(sock, 5);

client = l.accept(sock)

l.write(client, "Hello")

l.close(client)

l.close(sock)