Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1463 request stream的一个小问题 #1610

Closed
yxhtx opened this issue Jun 10, 2022 · 0 comments
Closed

#1463 request stream的一个小问题 #1610

yxhtx opened this issue Jun 10, 2022 · 0 comments

Comments

@yxhtx
Copy link

yxhtx commented Jun 10, 2022

我的代码:

skynet.fork(function()
	while true do
		local _stream<close> = stream
		local succ, _result = pcall(read_watch_stream, self, _stream)
		if not succ then
			skynet.logerror("read_watch_stream", _result)
			break
		end
		skynet.fork(watchcb, self, _result)
	end
end)

依赖to-be-closed特性自动调用stream.close时,最后会wakeup dead coroutine:

-- SKYNET_SOCKET_TYPE_CLOSE = 3
socket_message[3] = function(id)
	local s = socket_pool[id]
	if s == nil then
		return
	end
	s.connected = false
	wakeup(s)
end

请问是否应该判断dead croutine,还是说从使用上避免?

Repository owner locked and limited conversation to collaborators Jun 10, 2022
@cloudwu cloudwu converted this issue into discussion #1611 Jun 10, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant