mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
15 lines
267 B
Nim
15 lines
267 B
Nim
import net
|
|
|
|
let sock = newSocket(AF_UNIX, SOCK_STREAM, IPPROTO_IP)
|
|
sock.bindUnix("sock")
|
|
sock.listen()
|
|
|
|
while true:
|
|
var client = new(Socket)
|
|
sock.accept(client)
|
|
var output = ""
|
|
output.setLen 32
|
|
client.readLine(output)
|
|
echo "got ", output
|
|
client.close()
|