mirror of
https://github.com/lunarmodules/luasocket.git
synced 2024-12-26 04:28:20 +01:00
Uptated for LuaSocket 1.2. The version released was incompatible...
This commit is contained in:
parent
2c9008772e
commit
22a5d3f669
@ -1,15 +1,16 @@
|
|||||||
host = host or "localhost"
|
host = host or "localhost"
|
||||||
port = host or 8080
|
port = port or 8080
|
||||||
if arg then
|
if arg then
|
||||||
host = arg[1] or host
|
host = arg[1] or host
|
||||||
port = arg[2] or port
|
port = arg[2] or port
|
||||||
end
|
end
|
||||||
print("Binding to host '" ..host.. "' and port " ..port.. "...")
|
print("Binding to host '" ..host.. "' and port " ..port.. "...")
|
||||||
s, i, p, e = bind(host, port)
|
s, e = bind(host, port)
|
||||||
if not s then
|
if not s then
|
||||||
print(e)
|
print(e)
|
||||||
exit()
|
exit()
|
||||||
end
|
end
|
||||||
|
i, p = s:getsockname()
|
||||||
print("Waiting connection from talker on " .. i .. ":" .. p .. "...")
|
print("Waiting connection from talker on " .. i .. ":" .. p .. "...")
|
||||||
c, e = s:accept()
|
c, e = s:accept()
|
||||||
if not c then
|
if not c then
|
||||||
|
Loading…
Reference in New Issue
Block a user