diff options
author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2005-01-02 22:44:00 +0000 |
---|---|---|
committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2005-01-02 22:44:00 +0000 |
commit | 97b26e0b66c840a446a0179200c7df23565330d1 (patch) | |
tree | 272f9ea0451f13b563451fb8df21a03669e90d09 /samples/listener.lua | |
parent | a8254e94f8c14ac15b02be53a1cc69ba80899230 (diff) | |
download | luasocket-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.lua | 7 |
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 |
13 | end | 13 | end |
14 | print("Binding to host '" ..host.. "' and port " ..port.. "...") | 14 | print("Binding to host '" ..host.. "' and port " ..port.. "...") |
15 | s = socket.try(socket.bind(host, port)) | 15 | s = assert(socket.bind(host, port)) |
16 | i, p = socket.try(s:getsockname()) | 16 | i, p = s:getsockname() |
17 | assert(i, p) | ||
17 | print("Waiting connection from talker on " .. i .. ":" .. p .. "...") | 18 | print("Waiting connection from talker on " .. i .. ":" .. p .. "...") |
18 | c = socket.try(s:accept()) | 19 | c = assert(s:accept()) |
19 | print("Connected. Here is the stuff:") | 20 | print("Connected. Here is the stuff:") |
20 | l, e = c:receive() | 21 | l, e = c:receive() |
21 | while not e do | 22 | while not e do |