From 9ed7f955e5fc69af9bf1794fa2c8cd227981ba24 Mon Sep 17 00:00:00 2001 From: Diego Nehab Date: Fri, 4 Jun 2004 15:15:45 +0000 Subject: Só pra não perder se der merda. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- samples/cddb.lua | 5 +++-- samples/echoclnt.lua | 2 +- samples/echosrvr.lua | 2 +- samples/listener.lua | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) (limited to 'samples') 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 @@ -require"http" +socket = require("socket") +http = require("http") if not arg or not arg[1] or not arg[2] then print("luasocket cddb.lua []") @@ -31,7 +32,7 @@ end local host = socket.dns.gethostname() local query = "%s?cmd=cddb+read+%s+%s&hello=LuaSocket+%s+LuaSocket+2.0&proto=6" local url = string.format(query, server, arg[1], arg[2], host) -local body, headers, code, error = socket.http.get(url) +local body, headers, code, error = http.get(url) if code == 200 then 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 @@ -- Author: Diego Nehab -- RCS ID: $Id$ ----------------------------------------------------------------------------- -require"socket" +local socket = require("socket") host = host or "localhost" port = port or 7 if 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 @@ -- Author: Diego Nehab -- RCS ID: $Id$ ----------------------------------------------------------------------------- -require"socket" +socket = require("socket") host = host or "127.0.0.1" port = port or 7 if 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 @@ -- Author: Diego Nehab -- RCS ID: $Id$ ----------------------------------------------------------------------------- -require("socket") +local socket = require("socket") host = host or "*" port = port or 8080 if arg then -- cgit v1.2.3-55-g6feb