代码回调时序确认
#360
Replies: 1 comment
-
不能调整这里的顺序。 在执行on_stream_closed()回调时,需确保相应stream资源暂未释放。例如:应用层可能需要在该回调函数中输出stream相关信息;应用层也可能分配了流相关的资源并记录在stream上下文中,在流结束时需要查找并正确释放这些资源。 因此,在on_stream_closed()回调执行完成后,才会最终销毁stream。 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
in endpoint.rs
Event::StreamClosed(stream_id) => {
self.handler.on_stream_closed(conn, stream_id);
conn.stream_destroy(stream_id);
//上面两行代码能不能调整下顺序?先移除下stream id,然后再回调,我们在on_stream_closed回调函数里面做一些事情时,会出现streamid还没被移除的场景
}
Beta Was this translation helpful? Give feedback.
All reactions