Update libevent

Fix GetNextEvent. Now GetNextEvent will wait infinitely by default.
Update transport system due to libnetbox api update.
This commit is contained in:
Kirigaya Kazuto 2018-01-08 11:20:04 +08:00
parent 5c5ee4da37
commit 757d965bf2
3 changed files with 9 additions and 7 deletions

View File

@ -290,13 +290,17 @@ function GetNextEvent(t,wait_second)
checktable(t)
if(wait_second~=nil) then
checknumber(wait_second)
else
-- This has caused thousands of error! Now, without wait_second, by default, it means wait infinitely.
-- If you want a non-blocking check, call GetNextEvent(bus,0) instead!
wait_second=-1
end
if(t.events[1]~=nil) then
local e=t.events[1]
table.remove(t.events,1)
return e
elseif(wait_second~=nil) then
else
if(wait_second<0) then
while t.events[1]==nil do
os.sleep(1)
@ -316,8 +320,6 @@ function GetNextEvent(t,wait_second)
else
return nil
end
else
return nil
end
end

View File

@ -33,7 +33,7 @@ end
local function main()
checkDevice()
clientServiceStart()
NetBoxInit()
OpenPort(10010)
@ -57,7 +57,7 @@ local function main()
end
ClosePort(10010)
clientServiceStop()
NetBoxCleanUp()
end
print("Transport System Center Started.")

View File

@ -342,7 +342,7 @@ local function main()
checkDevice()
resetDevice()
clientServiceStart()
NetBoxInit()
while true do
print(
@ -367,7 +367,7 @@ local function main()
resetDevice()
unlockUnloadChest()
clientServiceStop()
NetBoxCleanUp()
end
print("Transport System Client Started.")