Few adjustments for windows.
This commit is contained in:
parent
71f6bb60bf
commit
bd54cd42d4
@ -63,13 +63,13 @@ end
|
|||||||
-- kind of copied from luasocket's manual callback examples
|
-- kind of copied from luasocket's manual callback examples
|
||||||
function receive2disk(file, size)
|
function receive2disk(file, size)
|
||||||
local aux = {
|
local aux = {
|
||||||
start = socket._time(),
|
start = socket.time(),
|
||||||
got = 0,
|
got = 0,
|
||||||
file = io.open(file, "wb"),
|
file = io.open(file, "wb"),
|
||||||
size = size
|
size = size
|
||||||
}
|
}
|
||||||
local receive_cb = function(chunk, err)
|
local receive_cb = function(chunk, err)
|
||||||
local dt = socket._time() - aux.start -- elapsed time since start
|
local dt = socket.time() - aux.start -- elapsed time since start
|
||||||
if not chunk or chunk == "" then
|
if not chunk or chunk == "" then
|
||||||
io.write("\n")
|
io.write("\n")
|
||||||
aux.file:close()
|
aux.file:close()
|
||||||
|
@ -84,19 +84,19 @@ function reconnect()
|
|||||||
remote [[
|
remote [[
|
||||||
if data then data:close() data = nil end
|
if data then data:close() data = nil end
|
||||||
data = server:accept()
|
data = server:accept()
|
||||||
data:setoption("nodelay", true)
|
-- data:setoption("nodelay", true)
|
||||||
]]
|
]]
|
||||||
data, err = socket.connect(host, port)
|
data, err = socket.connect(host, port)
|
||||||
if not data then fail(err)
|
if not data then fail(err)
|
||||||
else pass("connected!") end
|
else pass("connected!") end
|
||||||
data:setoption("nodelay", true)
|
-- data:setoption("nodelay", true)
|
||||||
end
|
end
|
||||||
|
|
||||||
pass("attempting control connection...")
|
pass("attempting control connection...")
|
||||||
control, err = socket.connect(host, port)
|
control, err = socket.connect(host, port)
|
||||||
if err then fail(err)
|
if err then fail(err)
|
||||||
else pass("connected!") end
|
else pass("connected!") end
|
||||||
control:setoption("nodelay", true)
|
-- control:setoption("nodelay", true)
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
test("method registration")
|
test("method registration")
|
||||||
|
@ -7,7 +7,7 @@ ack = "\n"
|
|||||||
while 1 do
|
while 1 do
|
||||||
print("server: waiting for client connection...");
|
print("server: waiting for client connection...");
|
||||||
control = server:accept()
|
control = server:accept()
|
||||||
control:setoption("nodelay", true)
|
-- control:setoption("nodelay", true)
|
||||||
while 1 do
|
while 1 do
|
||||||
command, error = control:receive()
|
command, error = control:receive()
|
||||||
if error then
|
if error then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user