From 4b7c2db4b7109bf57abd1b76abf24eba27f51aa1 Mon Sep 17 00:00:00 2001 From: Diego Nehab Date: Tue, 25 May 2004 06:52:06 +0000 Subject: [PATCH] Forgot this file. --- doc/socket.html | 135 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 doc/socket.html diff --git a/doc/socket.html b/doc/socket.html new file mode 100644 index 0000000..9372648 --- /dev/null +++ b/doc/socket.html @@ -0,0 +1,135 @@ + + + + +LuaSocket: Network support for the Lua language + + + + + + + +
+
+
+ + + +
+LuaSocket +
Network support for the Lua language +
+

+home · +download · +introduction · +reference +

+
+
+
+ + + +

The LuaSocket namespace

+ +

+The socket namespace contains the namespace tables for all +LuaSocket modules as well as function that didn't belong in any specific +module, functions that are so commonly used that deserve a shortcut and a +few constants. +

+ + + +

+socket.debug +

+ +

+This constant is set to true if the library was compiled +with debug support. +

+ + + + +

+socket.protect(function) +

+ +

+Converts a function that throws exceptions into a safe function. +

+ +

+Function is a function that calls +try to throw exceptions. +

+ +

+The function an equivalent function that instead of throwing exceptoins, +returns nil followed by an error message. +

+ + + +

+socket.try(ret1, ret2 ... retN) +

+ +

+Throws an exception in case of error. +

+ +

+Ret1, ret2 ... retN can be arbitrary +arguments, but are usually the return values of a function call that +nested with the call to try. +

+ +

+The function returns ret1, ret2 ... retN if +ret1 is not nil. Otherwise, calls error +passing ret2. +

+ +
+-- connects or throws an exception with the appropriate error message
+c = socket.try(socket.connect("localhost", 80))
+
+ + + +

+socket.version +

+ +

+This constant has a string describing the current LuaSocket version. +

+ + + + + + +