如何在 ace 中结束 Reactor 事件循环
我在 ace 中发现了两种结束反应堆事件循环的方法:
1. ACE_Reactor::instance()->end_reactor_event_loop();
2. ACE_Reactor::instance()->close()
它们之间有什么区别?我应该使用哪个?
I found two ways of ending a reactor event loop in ace:
1. ACE_Reactor::instance()->end_reactor_event_loop();
2. ACE_Reactor::instance()->close()
What is the difference between them? Which should I use?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
取决于你想做什么:
看看 本文档
基本上,两者之间的区别是:
end_reactor_event_loop
停止反应器处理消息,但不会释放资源,也不会删除队列中已有的任何消息。另一方面,
close
将执行上述操作并释放与 ACE_Reactor::intance() 实现相关的所有资源,从而删除消息,删除与因此,根据您在做什么,您可以选择其中之一,除此之外您还需要提供更多详细信息。
Depends on what you want to do:
Take a look at this documentation
Basically the difference between the 2 is:
end_reactor_event_loop
stops processing of the messages by the reactor but doesn't free resources and doesn't drop any messages already in the queues.close
on the other hand will do above and release all the resources associated with the implementation of theACE_Reactor::intance()
, consequently dropping messages deleting all sockets and handlers associated with the reactor, etc.So depending on what you are doing you can choose one or the other beyond that you would need to provide more details.