diff options
author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2001-03-06 19:54:57 +0000 |
---|---|---|
committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2001-03-06 19:54:57 +0000 |
commit | 22a5d3f669c2ad57b422b4cfa8e06cb4713aa12f (patch) | |
tree | e49c961c24290781304be40ae7d196357754a260 | |
parent | 2c9008772ef9c015569204bede90152ed975d0cc (diff) | |
download | luasocket-22a5d3f669c2ad57b422b4cfa8e06cb4713aa12f.tar.gz luasocket-22a5d3f669c2ad57b422b4cfa8e06cb4713aa12f.tar.bz2 luasocket-22a5d3f669c2ad57b422b4cfa8e06cb4713aa12f.zip |
Uptated for LuaSocket 1.2. The version released was incompatible...
-rw-r--r-- | samples/listener.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/samples/listener.lua b/samples/listener.lua index 5e1eb02..f9ee3bf 100644 --- a/samples/listener.lua +++ b/samples/listener.lua | |||
@@ -1,15 +1,16 @@ | |||
1 | host = host or "localhost" | 1 | host = host or "localhost" |
2 | port = host or 8080 | 2 | port = port or 8080 |
3 | if arg then | 3 | if arg then |
4 | host = arg[1] or host | 4 | host = arg[1] or host |
5 | port = arg[2] or port | 5 | port = arg[2] or port |
6 | end | 6 | end |
7 | print("Binding to host '" ..host.. "' and port " ..port.. "...") | 7 | print("Binding to host '" ..host.. "' and port " ..port.. "...") |
8 | s, i, p, e = bind(host, port) | 8 | s, e = bind(host, port) |
9 | if not s then | 9 | if not s then |
10 | print(e) | 10 | print(e) |
11 | exit() | 11 | exit() |
12 | end | 12 | end |
13 | i, p = s:getsockname() | ||
13 | print("Waiting connection from talker on " .. i .. ":" .. p .. "...") | 14 | print("Waiting connection from talker on " .. i .. ":" .. p .. "...") |
14 | c, e = s:accept() | 15 | c, e = s:accept() |
15 | if not c then | 16 | if not c then |