modify error process in socket channel

This commit is contained in:
changfeng
2014-06-25 23:11:00 +08:00
parent 984f727385
commit c0e1365dc2
2 changed files with 6 additions and 3 deletions

View File

@@ -132,9 +132,12 @@ local function dispatch_by_order(self)
else
close_channel_socket(self)
local errmsg
if result ~= socket_error then
if result_ok ~= socket_error then
errmsg = result_ok
end
self.__result[co] = socket_error
self.__result_data[co] = errmsg
skynet.wakeup(co)
wakeup_all(self, errmsg)
end
end

View File

@@ -79,11 +79,11 @@ skynet.start(function()
-- bad sql statement
local ok, res = pcall( db.query, db, "select * from notexisttable" )
print( dump(res) )
print( "ok= ",ok, dump(res) )
res = db:query("select * from cats order by id asc")
print ( dump( res ) )
skynet.exit()
end)