1
-----------------------------------------------------------------------------
2
-- TCP sample: Little program to dump lines received at a given port
3
-- LuaSocket sample files
5
-----------------------------------------------------------------------------
6
local socket = require("socket")
13
print("Binding to host '" ..host.. "' and port " ..port.. "...")
14
s = assert(socket.bind(host, port))
15
i, p = s:getsockname()
17
print("Waiting connection from talker on " .. i .. ":" .. p .. "...")
18
c = assert(s:accept())
19
print("Connected. Here is the stuff:")