aboutsummaryrefslogtreecommitdiff
path: root/samples/listener.lua
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2005-01-02 22:44:00 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2005-01-02 22:44:00 +0000
commit97b26e0b66c840a446a0179200c7df23565330d1 (patch)
tree272f9ea0451f13b563451fb8df21a03669e90d09 /samples/listener.lua
parenta8254e94f8c14ac15b02be53a1cc69ba80899230 (diff)
downloadluasocket-97b26e0b66c840a446a0179200c7df23565330d1.tar.gz
luasocket-97b26e0b66c840a446a0179200c7df23565330d1.tar.bz2
luasocket-97b26e0b66c840a446a0179200c7df23565330d1.zip
Almost ready to release beta3
Diffstat (limited to 'samples/listener.lua')
-rw-r--r--samples/listener.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/samples/listener.lua b/samples/listener.lua
index 65c6501..4d4c3b6 100644
--- a/samples/listener.lua
+++ b/samples/listener.lua
@@ -12,10 +12,11 @@ if arg then
12 port = arg[2] or port 12 port = arg[2] or port
13end 13end
14print("Binding to host '" ..host.. "' and port " ..port.. "...") 14print("Binding to host '" ..host.. "' and port " ..port.. "...")
15s = socket.try(socket.bind(host, port)) 15s = assert(socket.bind(host, port))
16i, p = socket.try(s:getsockname()) 16i, p = s:getsockname()
17assert(i, p)
17print("Waiting connection from talker on " .. i .. ":" .. p .. "...") 18print("Waiting connection from talker on " .. i .. ":" .. p .. "...")
18c = socket.try(s:accept()) 19c = assert(s:accept())
19print("Connected. Here is the stuff:") 20print("Connected. Here is the stuff:")
20l, e = c:receive() 21l, e = c:receive()
21while not e do 22while not e do