diff options
Diffstat (limited to 'script')
-rw-r--r-- | script/brave/work.lua | 2 | ||||
-rw-r--r-- | script/proto/proto.lua | 7 | ||||
-rw-r--r-- | script/service/service.lua | 4 |
3 files changed, 4 insertions, 9 deletions
diff --git a/script/brave/work.lua b/script/brave/work.lua index 0514d1e2..cdba955e 100644 --- a/script/brave/work.lua +++ b/script/brave/work.lua @@ -54,7 +54,7 @@ brave.on('loadProtoBySocket', function (param) function lsmaster:on_data(data) lsclient:write(data) - net.update() + --net.update() end while true do diff --git a/script/proto/proto.lua b/script/proto/proto.lua index 01ff8238..78400f97 100644 --- a/script/proto/proto.lua +++ b/script/proto/proto.lua @@ -55,7 +55,6 @@ function m.send(data) io.write(buf) elseif m.mode == 'socket' then m.client:write(buf) - net.update() end end @@ -258,15 +257,9 @@ function m.listen(mode, socketPort) } m.client = dummyClient - local t = timer.loop(0.1, function () - net.update() - end) - function server:on_accepted(client) - t:remove() m.client = client client:write(dummyClient.buf) - net.update() end pub.task('loadProtoBySocket', { diff --git a/script/service/service.lua b/script/service/service.lua index 2c19b4f6..c3afd4cf 100644 --- a/script/service/service.lua +++ b/script/service/service.lua @@ -12,6 +12,7 @@ local ws = require 'workspace' local time = require 'bee.time' local fw = require 'filewatch' local furi = require 'file-uri' +local net = require 'service.net' require 'jsonc' require 'json-beautify' @@ -168,6 +169,7 @@ function m.eventLoop() end local function doSomething() + net.update() timer.update() pub.step(false) if await.step() then @@ -180,7 +182,7 @@ function m.eventLoop() local function sleep() idle() for _ = 1, 10 do - thread.sleep(100) + net.update(100) if doSomething() then return end |