关于ACE反应堆模式的问题,求助! [英] questions about ACE reactor pattern ,help!

查看:82
本文介绍了关于ACE反应堆模式的问题,求助!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是反应堆模式的新手,我知道这种模式可以解决传统的块套接字编程中每个客户端的每个线程问题,我的问题是,事件调度程序将调用虚函数handle_input来指示我们可以读取现在,但是程序逻辑是在这样的函数中发生的。有时候,我们需要通过调用send来向对等端发回一些东西,但这是发送功能块或非块,(据我所知,套接字是非同步模型中的非阻止)或如何确保它可以成功发送?那么在这种情况下块加螺纹和非块+反应器模式有什么区别,请帮助!!!非常感谢。

I am new to reactor pattern , i know that this pattern can solve the per client per thread problem in traditional block socket programming ,my question is that the virual function handle_input will be called by the event dispatcher to indicate that we can read now ,but is the program logic happens in such function .sometimes ,we need to send something back the the peer side by calling send for example ,but is this send function block or non block ,(as far as i know ,the socket is non block in async model)or how can i ensure it can send successfully ? then what's the difference between block plus thread and non block + reactor pattern in this case ,please help!!! many thanks.

推荐答案

这篇关于关于ACE反应堆模式的问题,求助!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆