aboutsummaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2004-06-04 15:15:45 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2004-06-04 15:15:45 +0000
commit9ed7f955e5fc69af9bf1794fa2c8cd227981ba24 (patch)
tree8c3521366ef84f534bbec278437be7ea24e2ac1c /samples
parent63d60223da9de60f873ca08a25dbd9512c998929 (diff)
downloadluasocket-9ed7f955e5fc69af9bf1794fa2c8cd227981ba24.tar.gz
luasocket-9ed7f955e5fc69af9bf1794fa2c8cd227981ba24.tar.bz2
luasocket-9ed7f955e5fc69af9bf1794fa2c8cd227981ba24.zip
Só pra não perder se der merda.
Diffstat (limited to 'samples')
-rw-r--r--samples/cddb.lua5
-rw-r--r--samples/echoclnt.lua2
-rw-r--r--samples/echosrvr.lua2
-rw-r--r--samples/listener.lua2
4 files changed, 6 insertions, 5 deletions
diff --git a/samples/cddb.lua b/samples/cddb.lua
index d2e5b59..0ceba09 100644
--- a/samples/cddb.lua
+++ b/samples/cddb.lua
@@ -1,4 +1,5 @@
1require"http" 1socket = require("socket")
2http = require("http")
2 3
3if not arg or not arg[1] or not arg[2] then 4if not arg or not arg[1] or not arg[2] then
4 print("luasocket cddb.lua <category> <disc-id> [<server>]") 5 print("luasocket cddb.lua <category> <disc-id> [<server>]")
@@ -31,7 +32,7 @@ end
31local host = socket.dns.gethostname() 32local host = socket.dns.gethostname()
32local query = "%s?cmd=cddb+read+%s+%s&hello=LuaSocket+%s+LuaSocket+2.0&proto=6" 33local query = "%s?cmd=cddb+read+%s+%s&hello=LuaSocket+%s+LuaSocket+2.0&proto=6"
33local url = string.format(query, server, arg[1], arg[2], host) 34local url = string.format(query, server, arg[1], arg[2], host)
34local body, headers, code, error = socket.http.get(url) 35local body, headers, code, error = http.get(url)
35 36
36if code == 200 then 37if code == 200 then
37 local data, code, error = parse(body) 38 local data, code, error = parse(body)
diff --git a/samples/echoclnt.lua b/samples/echoclnt.lua
index 877e99b..038061d 100644
--- a/samples/echoclnt.lua
+++ b/samples/echoclnt.lua
@@ -4,7 +4,7 @@
4-- Author: Diego Nehab 4-- Author: Diego Nehab
5-- RCS ID: $Id$ 5-- RCS ID: $Id$
6----------------------------------------------------------------------------- 6-----------------------------------------------------------------------------
7require"socket" 7local socket = require("socket")
8host = host or "localhost" 8host = host or "localhost"
9port = port or 7 9port = port or 7
10if arg then 10if arg then
diff --git a/samples/echosrvr.lua b/samples/echosrvr.lua
index 79bff8f..73bf374 100644
--- a/samples/echosrvr.lua
+++ b/samples/echosrvr.lua
@@ -4,7 +4,7 @@
4-- Author: Diego Nehab 4-- Author: Diego Nehab
5-- RCS ID: $Id$ 5-- RCS ID: $Id$
6----------------------------------------------------------------------------- 6-----------------------------------------------------------------------------
7require"socket" 7socket = require("socket")
8host = host or "127.0.0.1" 8host = host or "127.0.0.1"
9port = port or 7 9port = port or 7
10if arg then 10if arg then
diff --git a/samples/listener.lua b/samples/listener.lua
index bedbde5..b2f7a7e 100644
--- a/samples/listener.lua
+++ b/samples/listener.lua
@@ -4,7 +4,7 @@
4-- Author: Diego Nehab 4-- Author: Diego Nehab
5-- RCS ID: $Id$ 5-- RCS ID: $Id$
6----------------------------------------------------------------------------- 6-----------------------------------------------------------------------------
7require("socket") 7local socket = require("socket")
8host = host or "*" 8host = host or "*"
9port = port or 8080 9port = port or 8080
10if arg then 10if arg then