Lua Socket

From GiderosMobile
Revision as of 15:42, 20 May 2023 by MoKaLux (talk | contribs) (Created page with "__NOTOC__ <!-- GIDEROSOBJ:luasocket--> '''Supported platforms:''' File:Platform android.pngFile:Platform ios.pngFile:Platform mac.pngFile:Platform pc.pngFile...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Supported platforms: Platform android.pngPlatform ios.pngPlatform mac.pngPlatform pc.pngPlatform html5.pngPlatform winrt.pngPlatform win32.png
Available since: Gideros 2013.x

Description

LuaSocket is a Lua extension library that is composed by two parts: a C core that provides support for the TCP and UDP transport layers, and a set of Lua modules that add support for the SMTP (sending e-mails), HTTP (WWW access) and FTP (uploading and downloading files) protocols and other functionality commonly needed by applications that deal with the Internet.

For more info please see: https://w3.impa.br/~diego/software/luasocket/introduction.html


To add Lua Socket support to your application you call:

socket = require("socket.core")
  Lua Socket seems to work without Lua Socket plugin at all!

Example

local socket = require("socket.core")
client = socket.connect("google.com", 80)
client:send("GET /robots.txt HTTP/1.0\r\n\r\n")
while true do
	s, status, partial = client:receive(1024)
	print(s or partial)
		if status == "closed" then 
			break 
		end
end
client:close()

Methods TO DO

--> -->

Events

Constants