Skip to content

Commit

Permalink
socket连接把错误打印到日志中
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Apr 19, 2024
1 parent f96930c commit a449b5f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions script/brave/work.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,19 @@ brave.on('loadProtoBySocket', function (param)
coroutine.resume(parser)
end

function lsclient:on_error(...)
log.error(...)
end

function lsmaster:on_data(data)
lsclient:write(data)
--net.update()
end

function lsmaster:on_error(...)
log.error(...)
end

while true do
net.update(10)
end
Expand Down
4 changes: 4 additions & 0 deletions script/proto/proto.lua
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ function m.listen(mode, socketPort)
return true
end

function server:on_error(...)
log.error(...)
end

pub.task('loadProtoBySocket', {
port = socketPort,
unixPath = unixPath,
Expand Down

0 comments on commit a449b5f

Please sign in to comment.