Google 网上论坛不再支持新的 Usenet 帖子或订阅项。历史内容仍可供查看。

Problem with ProActor since version 5.4.8

已查看 18 次
跳至第一个未读帖子

Daniel

未读,
2006年2月16日 04:03:272006/2/16
收件人
I've got the following problem with ACE under WinXP:

My server uses the ACE Proactor and is working fine as long as I use
an ACE version < 5.4.8. I tried 5.4.8 and 5.4.9 and both versions give
me the following error messages:

Either after around 5 seconds I get this message:
"ACE_Asynch_Acceptor::accept: no buffer space available"

or alternatively I get immediately this:
"ACE_Select_Reactor_T::open failed inside ACE_Select_Reactpr_T:CTOR:
not connected
.\Asynch_Pseudo_Task.cpp:30:start reactor is not inialized: not
connected
ACE_OS::listen: no buffer space available"

In both cases the server does not accept any connections.
Again, the server worked fine with all versions i used <5.4.8.

BTW: after these errors my network stacks seems to be quite messed up.
i have to reboot to make all things work again (ProActor with older
ACE version as well as other applications).

Any ideas what the problem is and how to make my application work with
ACE 5.4.8 and later?

thanks a lot,
Daniel

Douglas C. Schmidt

未读,
2006年2月16日 09:23:152006/2/16
收件人
Hi Daniel,

I don't think anyone else has run into this before. All our test
cases seem to work fine. Do you have a simple test case that
illustrates the problem?

Thanks,

Doug


--
Dr. Douglas C. Schmidt Professor and Associate Chair
Electrical Engineering and Computer Science TEL: (615) 343-8197
Institute for Software Integrated Systems WEB: www.dre.vanderbilt.edu/~schmidt
Vanderbilt University, Nashville TN, 37203 NET: d.sc...@vanderbilt.edu

alexander libman

未读,
2006年2月16日 15:27:332006/2/16
收件人
Hi Doug, Daniel

Couple days ago I met with this issiue also.

The problem can be in modified config-win32-common.h (since 5.4.8):

#if !defined (ACE_DEFAULT_BACKLOG)
# define ACE_DEFAULT_BACKLOG SOMAXCONN
#endif /* ACE_DEFAULT_BACKLOG

from XP winsock2.h:
#define SOMAXCONN 0x7fffffff

-----------------------------------------------------
as result ACE_Asynch_Acceptor starts issues asynch accepts in infinite loop
and consuming resources:


template <class HANDLER> int
ACE_Asynch_Acceptor<HANDLER>::open (const ACE_INET_Addr &address,
size_t bytes_to_read,
int pass_addresses,
int backlog, // <------- default ACE_DEFAULT_BACKLOG
int reuse_addr,
ACE_Proactor *proactor,
int validate_new_connection,
int reissue_accept,
int number_of_initial_accepts // <---- default -1
{
.....
// For the number of <intial_accepts>.
if (number_of_initial_accepts == -1)
number_of_initial_accepts = backlog; //SOMAXCONN


for (int i = 0; i < number_of_initial_accepts; i++)
{
// Initiate accepts.
if (this->accept (bytes_to_read) == -1)

...
}

Current workaround: to setup another value for ACE_DEFAULT_BACKLOG
or to specify explicitly all parameters in ACE_Asynch_Acceptor::open () call

Thanks,
Alex

Douglas C. Schmidt

未读,
2006年2月16日 16:02:102006/2/16
收件人
Hi Alex,

>> Couple days ago I met with this issiue also.
>>
>> The problem can be in modified config-win32-common.h (since 5.4.8):
>>
>> #if !defined (ACE_DEFAULT_BACKLOG)
>> # define ACE_DEFAULT_BACKLOG SOMAXCONN
>> #endif /* ACE_DEFAULT_BACKLOG
>>
>> from XP winsock2.h:
>> #define SOMAXCONN 0x7fffffff

Hum, I can see why there should be a problem - that looks like a BIG
number ;-)

Does anyone have a better "out-of-the-box" solution here that won't
cause problems?

Thanks,

Doug

Alexander Libman

未读,
2006年2月16日 23:50:362006/2/16
收件人
Hi Doug,
I assumed workaround for the existing version
i.e. to include in client config.h desired ACE_DEFAULT_BACKLOG value .
Since ACE_Asynch_Acceptor is a template class, no need to rebuild ACE,
only client application.

For future versions possible approaches:
a) define new macro ACE_MAX_ASYNCH_ACCEPTS
I am not sure if it is good as we have a lot macros already
or
b) template <class HANDLER, int max_num_asynch_accepts = 10>
class ACE_Asynch_Acceptor
{
...
};

and replace
if (number_of_initial_accepts == -1)
number_of_initial_accepts = max_num_asynch_accepts ;

Alex

Daniel

未读,
2006年2月17日 01:02:482006/2/17
收件人
On 16 Feb 2006 22:50:36 -0600, "Alexander Libman"
<alexande...@earthlink.net> wrote:

>I assumed workaround for the existing version
>i.e. to include in client config.h desired ACE_DEFAULT_BACKLOG value .
>Since ACE_Asynch_Acceptor is a template class, no need to rebuild ACE,
>only client application.

hi Alex,

first, i'm glad i'm not the only person with that problem and that
somebody else (who obviously has more inside knowledge on ACE) shares
these experiences.

this may sound stupid, but what would be a good value for
ACE_DEFAULT_BACKLOG or for number_of_initial_accepts?

thx,
Daniel

Douglas C. Schmidt

未读,
2006年2月17日 09:28:492006/2/17
收件人
Hi Alex,

>> I assumed workaround for the existing version
>> i.e. to include in client config.h desired ACE_DEFAULT_BACKLOG value .
>> Since ACE_Asynch_Acceptor is a template class, no need to rebuild ACE,
>> only client application.

Right - the problem here is that changing ACE_DEFAULT_BACKLOG affects
the non-Proactor backlog!

>> For future versions possible approaches:
>> a) define new macro ACE_MAX_ASYNCH_ACCEPTS

I think this is the best solution. I've added a new macro called
ACE_DEFAULT_ASYNCH_BACKLOG which is set as follows:

Fri Feb 17 08:15:57 2006 Douglas C. Schmidt <sch...@cse.wustl.edu>

* ace/Asynch_Acceptor.h: Used ACE_DEFAULT_ASYNCH_BACKLOG instead
of ACE_DEFAULT_BACKLOG since the latter is set to a huge value
on Windows. Thanks to Alex Libman and Daniel <__daniel___ at icg
do tu-graz dot ac dot at> for their help.

* ace/Default_Constants.h: Added a new macro called
ACE_DEFAULT_ASYNCH_BACKLOG that defaults to 5.

Daniel, can you please download

http://www.cs.wustl.edu/~schmidt/ACE_wrappers/ace/Asynch_Acceptor.h
http://www.cs.wustl.edu/~schmidt/ACE_wrappers/ace/Default_Constants.h

and see if that works for you? If so, we'll add this before the x.5
release comes out (but it won't be in x.4.10). Daniel, can you also
please let us know your last name for the THANKS file?!

Thanks,

Doug

Daniel

未读,
2006年2月17日 19:32:522006/2/17
收件人
On 17 Feb 2006 08:28:49 -0600, "Douglas C. Schmidt"
<sch...@cse.wustl.edu> wrote:

>Daniel, can you please download
>
>http://www.cs.wustl.edu/~schmidt/ACE_wrappers/ace/Asynch_Acceptor.h
>http://www.cs.wustl.edu/~schmidt/ACE_wrappers/ace/Default_Constants.h
>
>and see if that works for you? If so, we'll add this before the x.5
>release comes out (but it won't be in x.4.10). Daniel, can you also
>please let us know your last name for the THANKS file?!

The ProActor works now!

This is really good news since it means that i can finally use the
same ACE version for Windows CE (which works again since 5.4.8) and
Windows XP (which stopped working for me with 5.4.8).

thanks a lot!

I'm not sure if i earned being listed in the THANKS file for this
simple bug report (not even using the template) but if you want to add
me then my last name is: "Wagner"

thanks again for the great support,
Daniel

Douglas C. Schmidt

未读,
2006年2月17日 20:50:172006/2/17
收件人
Hi Daniel,

>> The ProActor works now!

Great!

>> This is really good news since it means that i can finally use the
>> same ACE version for Windows CE (which works again since 5.4.8) and
>> Windows XP (which stopped working for me with 5.4.8).

Cool!

>> thanks a lot!

No problemo! Again, this will be integrated into the x.5 release, not
x.4.10, which is due out shortly.

>> I'm not sure if i earned being listed in the THANKS file for this
>> simple bug report (not even using the template) but if you want to add
>> me then my last name is: "Wagner"

Thanks Daniel!

0 个新帖子