From f37e0260261f7691246429d227cf7124c291e8b1 Mon Sep 17 00:00:00 2001
From: Diego Nehab LuaSocket 2.0.2 uses the new package system for Lua 5.1.
-All Lua library developers are encouraged to update their libraries so that
-all libraries can coexist peacefully and users can benefit from the
-standardization and flexibility of the standard.
-
-Those stuck with Lua 5.0 will need the
-compat-5.1
-module. It is maintained by
-The Kepler
-Project's team, and implements the Lua 5.1 package proposal
-on top of Lua 5.0. LuaSocket 2.1.1-rc still uses Lua 5.1's package
+system. Users that have already made the switch to
+Lua 5.2 should leave the default
+LUA_COMPAT_MODULE defined when compiling their Lua
+distribution for compatibility with LuaSocket. Here we will only describe the standard distribution.
-If the standard doesn't meet your needs, we refer you to the
-Lua discussion list, where any question about the package
-scheme will likely already have been answered. Here we describe the standard distribution. If the
+standard doesn't meet your needs, we refer you to the Lua
+discussion list, where any question about the package scheme
+will likely already have been answered. Installation
-Directory structure
@@ -64,14 +56,19 @@ scheme will likely already have been answered.
-<LDIR>/compat-5.1.lua <LDIR>/ltn12.lua <LDIR>/socket.lua <CDIR>/socket/core.dll @@ -88,33 +85,6 @@ distribution directory structure: would be replaced by core.so. -In order for the interpreter to find all LuaSocket components, three -environment variables need to be set. The first environment variable tells -the interpreter to load the compat-5.1.lua module at startup:
- --LUA_INIT=@<LDIR>/compat-5.1.lua -- --This is only need for Lua 5.0! Lua 5.1 comes with -the package system built in, of course. -
- --The other two environment variables instruct the compatibility module to -look for dynamic libraries and extension modules in the appropriate -directories and with the appropriate filename extensions. -
- --LUA_PATH=<LDIR>/?.lua;?.lua -LUA_CPATH=<CDIR>/?.dll;?.dll -- -Again, naturally, on Unix systems the shared library extension would be -.so instead of .dll.
-Using LuaSocket
With the above setup, and an interpreter with shared library support, @@ -122,19 +92,19 @@ it should be easy to use LuaSocket. Just fire the interpreter and use the require function to gain access to whatever module you need:
-Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-Rio +Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio > socket = require("socket") > print(socket._VERSION) ---> LuaSocket 2.0.2 +--> LuaSocket 2.1.1-rc1Each module loads their dependencies automatically, so you only need to load the modules you directly depend upon:
-Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-Rio +Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio > http = require("socket.http") -> print(http.request("http://www.cs.princeton.edu/~diego/professional/luasocket")) +> print(http.request("http://www.impa.br/~diego/software/luasocket")) --> homepage gets dumped to terminal@@ -153,7 +123,7 @@ Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-RioLast modified by Diego Nehab on
-- cgit v1.2.3-55-g6feb
-Thu Apr 20 00:25:30 EDT 2006 +Mon Apr 16 21:01:42 HKT 2012