Skip to content

Commit a449b5f

Browse files
committed
socket连接把错误打印到日志中
1 parent f96930c commit a449b5f

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

script/brave/work.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,19 @@ brave.on('loadProtoBySocket', function (param)
5252
coroutine.resume(parser)
5353
end
5454

55+
function lsclient:on_error(...)
56+
log.error(...)
57+
end
58+
5559
function lsmaster:on_data(data)
5660
lsclient:write(data)
5761
--net.update()
5862
end
5963

64+
function lsmaster:on_error(...)
65+
log.error(...)
66+
end
67+
6068
while true do
6169
net.update(10)
6270
end

script/proto/proto.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,10 @@ function m.listen(mode, socketPort)
268268
return true
269269
end
270270

271+
function server:on_error(...)
272+
log.error(...)
273+
end
274+
271275
pub.task('loadProtoBySocket', {
272276
port = socketPort,
273277
unixPath = unixPath,

0 commit comments

Comments
 (0)