DOCGroup / ACE_TAO

ACE and TAO
https://www.dre.vanderbilt.edu/~schmidt/TAO.html
698 stars 374 forks source link

Reactor integrate Proactor : QtReactor can not register_handler with ACE_Win32_Proactor. #728

Open jhenchen opened 5 years ago

jhenchen commented 5 years ago

Version

ACE : 6.5.2

Host machine and operating system

Windows 7 64bit

Compiler name and version (including patch level)

VS2010

AREA/CLASS/EXAMPLE AFFECTED:

QtReactor

The problem effects & Synopsis & Description

I was developing a project ,which can recv data from udp and serial port, and draw data to GUI. I use Reactor framework (Implement is QtReactor ) to handle udp events. Because on Windows,Reactor don't support serial port IO, I use Proactor to handle serial port IO. Both goes well independtly (one framework one process). when I combine these into a process, I got error. code as follow:

QApplication a(argc,argv);
Mainwindow w;

ACE_Proactor::close_singleton();
ACE_WIN32_Proactor *impl = new ACE_WIN32_Proactor(0,1);
ACE_Proactor::instance(new ACE_WIN32_Proactor(impl,1),1);

ACE_QtReactor qtreactor(&a);
ACE_Reactor reactor;

reactor.register_handler(impl,impl->get_handle());
.....

register_handler return -1. if I use ACE_Reactor::instance()->register_handler(impl,impl->get_handle()), it return correct.

I guess QtReactor don't support register_handler(impl,impl->get_handle()).

jwillemsen commented 5 years ago

The ACE_Select_Reactor_T (from which the ACE_QtReactor is derived) doesn't implement this specific register_handler operation (see ace/Select_Reactor_T.inl around line 75). Because of this notsup you get a -1 back.