Widow System luaforwindows, installation Luasocket

Source: Internet
Author: User
Tags lua

Reference http://94it.net/a/jingxuanboke/2013/0625/49052.html

1.

I'm using a luaforwindows_v5.1.4-46.exe.

can be downloaded in my Baidu network disk,

Http://pan.baidu.com/s/1nt4yYCD

I installed it in the C:\Program files\lua\5.1

2, I downloaded on the official website Luasocket-2.0.2-lua-5.1.2-win32-vc8 http://files.luaforge.net/releases/luasocket/luasocket/luasocket-2.0.2

Copy the Mime,socket folder in Luasocket-2.0.2-lua-5.1.2-win32-vc8 to C:\Program files\lua\5.1 (and the Lua folder in the same directory)

3, open SciTE, test require ("socket") whether error

Local ScriptPath = "C:\\Program files\\lua\\5.1\\"--getscriptdirectory () Local lua_cpath1 = ScriptPath ... "?. DLL "--Path setting is certain if this is set, otherwise there will be an error, or find" Socket.core "error local lua_path1 = ScriptPath ..." Lua\\?. Lua; ". ScriptPath. " Lua\\socket\\?. Lua "Package.path = Package.path"; ".. Lua_path1package.cpath = Package.cpath: ";".. Lua_cpath1print (lua_cpath1) print (lua_path1) require ("socket") local socket = require ("socket") Local host = " www.baidu.com "Local file ="/"--Create a TCP connection to the standard port on the HTTP connection--port 80 on local sock = assert (Socket.connect (host)) sock:s End ("GET": File: "http/1.0\r\n\r\n") repeat    --takes 1K bytes to receive the data, and receives the byte block output to the    local chunk, status, partial = Sock:receive (1024x768)    Print (chunk or partial) until status ~= "closed"--close TCP connection sock:close ()

Widow System luaforwindows, installation Luasocket

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.