merge conflicts
This commit is contained in:
commit
eb6c7ba651
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,3 +1,6 @@
|
|||||||
|
# lua-env
|
||||||
|
luajit/*
|
||||||
|
|
||||||
# Compiled Lua sources
|
# Compiled Lua sources
|
||||||
luac.out
|
luac.out
|
||||||
|
|
||||||
|
|||||||
44
client.lua
44
client.lua
@ -1,41 +1,20 @@
|
|||||||
package.path = "./?/init.lua;./?.lua;"..package.path
|
package.path = "./?/init.lua;./?.lua;"..package.path
|
||||||
local net = require("lnet.tcp")
|
local net = require("lnet.tcp")
|
||||||
local multi, thread = require("multi"):init()
|
local multi, thread = require("multi"):init()
|
||||||
|
--
|
||||||
|
-- local http = require("lnet.http")
|
||||||
|
-- local http_ = require("socket.http")
|
||||||
|
|
||||||
local http = require("lnet.http")
|
local http = require("lnet.http")
|
||||||
--local https = require("lnet.https")
|
|
||||||
local https = require("ssl.https")
|
|
||||||
|
|
||||||
-- multi:newThread("Download Test",function()
|
-- multi:newThread("Timer",function()
|
||||||
-- http.request:holdMe(false) -- Gain Access to the return manager
|
-- while true do
|
||||||
-- local data = http.request {
|
-- thread.sleep(8)
|
||||||
-- url = "http://files.luaforge.net/releases/luaforwindows/luaforwindows/5.1.4-35/LuaForWindows_v5.1.4-35.exe",
|
-- print("...")
|
||||||
-- sink = ltn12.sink.file(io.open("test.exe","wb"))
|
-- end
|
||||||
-- }
|
|
||||||
-- local t={}
|
|
||||||
-- data.OnStatus(function(part,whole)
|
|
||||||
-- local per = math.ceil((part/whole)*100)
|
|
||||||
-- if not t[per] then
|
|
||||||
-- print("T1",per)
|
|
||||||
-- t[per] = true
|
|
||||||
-- end
|
|
||||||
-- end)
|
|
||||||
-- local c = os.clock()
|
|
||||||
-- thread.hold(data.connect())
|
|
||||||
-- print("Done!",os.clock()-c)
|
|
||||||
-- end)
|
-- end)
|
||||||
|
--download("http://212.183.159.230/5MB.zip","test1.bin")
|
||||||
multi:newThread("Download Test 2",function()--https://erowall.com/download_img.php?dimg=16911&raz=2560x1600
|
--download("http://212.183.159.230/50MB.zip","test2.bin").OnError(print)
|
||||||
local data,err = https.request("https://erowall.com/download_img.php?dimg=16911&raz=2560x1600")
|
|
||||||
local file = io.open("test.jpg","wb")
|
|
||||||
file:write(data)
|
|
||||||
file:flush()
|
|
||||||
file:close()
|
|
||||||
print("Done!")
|
|
||||||
os.exit()
|
|
||||||
end).OnError(function(self,err)
|
|
||||||
print(">>",err)
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- local client = net.newCastedClient("Test")--net:newTCPClient("localhost",12345)
|
-- local client = net.newCastedClient("Test")--net:newTCPClient("localhost",12345)
|
||||||
|
|
||||||
@ -44,4 +23,5 @@ end)
|
|||||||
-- client.OnDataRecieved(function(c,data)
|
-- client.OnDataRecieved(function(c,data)
|
||||||
-- print("Response: ",data)
|
-- print("Response: ",data)
|
||||||
-- end)
|
-- end)
|
||||||
multi:mainloop()
|
|
||||||
|
--multi:mainloop()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user