ACE_TAO 017 ACE_wrappersexamplesReactor

Posted islinyoubiao

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ACE_TAO 017 ACE_wrappersexamplesReactor相关的知识,希望对你有一定的参考价值。

看一个开源项目,示例代码是最直接的教程了。

ACE的Reactor代码如下图所示:

 打开README

This directory contains subdirectories that test the ACE Reactor and Proactor

  . Dgram
    Tests the CODgram and Dgram classes with the Reactor.

  . Misc
    Various miscellaneous tests of Reactor functionality
    (e.g., signals, timers, notification, etc.).

  . Multicast
    Tests out the ACE multicast capabilities in conjunction
    with the Reactor.

  . Ntalker
    A program that implements a multicast "chat" program.


  . Proactor
    A program that illustrates the "Proactive" version of
    the Reactor

用表格展示

代码内容
Dgram

基于UDP协议,包括ACE_SOCK_Dgram和ACE_SOCK_CODgram

http://www.dre.vanderbilt.edu/Doxygen/5.4/html/ace/a01650.html

http://www.dre.vanderbilt.edu/Doxygen/5.4/html/ace/a01647.html

FIFOFIFO一般指先入先出队列。用FIFO实现的服务——客户模型是用一个公共的只读管道接受请求,然后根据请求进程的进程ID另创建一个新的管道与其通信。
MiscReactor所有函数的测试例子
Multicast

UDP广播

https://blog.csdn.net/qq_41278986/article/details/118311200

NtalkerThis test program illustrates how the ACE datagram multicast feature works.
Proactor

This README file lists all the example applications for the Proactor framework.在高性能的I/O设计中,有两个比较著名的模式Reactor和Proactor模式,其中Reactor模式用于同步I/O,而Proactor运用于异步I/O操作。

https://blog.csdn.net/weiwangchao_/article/details/42917507

TP_Reactor

This program demonstrates what we think is a bug in the ACE library. The
affected component is the ACE_TP_Reactor. According to the documentation, the
reactor ensures that only one of the handle_*() methods of an event handler is
called at a time. Tino found this to be not true and I wrote this example
program showing the behavior. I do not exclude the possibility that we are
using the ACE library in an unintended/wrong way. So comments on the code as
well as any other remarks are welcome.

就是ACE的Reactor测试框架

https://blog.csdn.net/chinaclock/article/details/49120497

https://blog.csdn.net/bingozq/article/details/2453570

WFMO_ReactorWFMO_Reactor是ACE_Reactor在Windows下的默认实现(为什么不选择ACE_Select_Reactor作为默认实现,可能是基于效率和强大性的考虑),WFMO_Reactor的低层使用的函数是WaitForMultipleObjects和WSAEventSelect,WSAEnumNetworkEvents。其中WaitForMultipleObjects函数用于处理线程,互斥量,信号灯,事件,定时器等事件,而WSAEventSelect用于处理网络IO事件。
https://blog.csdn.net/fullsail/article/details/2901792

总结:

Reactor的应用程序继承ACE_Event_Handler类,调用相关的封装实现网络通讯,包括UDP和TCP协议。自带断线重连功能。非常好用。

多谢,亲爱的美美。

以上是关于ACE_TAO 017 ACE_wrappersexamplesReactor的主要内容,如果未能解决你的问题,请参考以下文章

ACE_TAO 017 ACE_wrappersexamplesReactor

ACE_TAO

ACE_TAO 007

ACE_TAO 005

ACE_TAO 006

ACE_TAO 003