找回密码
 用户注册

QQ登录

只需一步,快速开始

查看: 11745|回复: 5

Dev_Poll_Reactor运行错误.

[复制链接]
发表于 2007-12-24 23:30:12 | 显示全部楼层 |阅读模式
ACE_Dev_Poll_Reactor::open failed inside ACE_Dev_Poll_Reactor::CTOR: No such file or directory
请大家帮忙,我是这样创建的:
ACE_Dev_Poll_Reactor dp_reactor(5120)
 楼主| 发表于 2007-12-24 23:30:20 | 显示全部楼层
5120是什么?兄弟,问问题要有代码和上下文环境,这样的问题,大家没法解决啊?
 楼主| 发表于 2007-12-24 23:30:26 | 显示全部楼层
5120是我要创建的服务器的连接数.

ClientService是从ACE_Svc_Handler继承而来的.

typedef ACE_ACCEPTOR<ClientService,SOCK_ACCEPTOR> ClientAcceptor;

ACE_INET_Addr port_to_listen(9000);

ACE_Dev_Poll_Reactor dp_reactor(5120)

ACE_Reactor reactor(&dp_reactor);

ClientAcceptor acceptor;

acceptor.open(port_to_listen,&reactor,flags);

reactor.run_reactor_event_loop();

就这样可以了吧.
 楼主| 发表于 2007-12-24 23:30:34 | 显示全部楼层
ACE_Dev_Poll_Reactor::ACE_Dev_Poll_Reactor  ( size_t  size,  
  int  restart = 0,  
  ACE_Sig_Handler *  = 0,  
  ACE_Timer_Queue *  = 0,  
  int  disable_notify_pipe = 0,  
  ACE_Reactor_Notify *  notify = 0,  
  int  mask_signals = 1,  
  int  s_queue = ACE_DEV_POLL_TOKEN::FIFO   
)   

Initialize ACE_Dev_Poll_Reactor with size size.


注解:
On Unix platforms, the size parameter should be as large as the maximum number of file descriptors allowed for a given process. This is necessary since a file descriptor is used to directly index the array of event handlers maintained by the Reactor's handler repository. Direct indexing is used for efficiency reasons. If the size parameter is less than the process maximum, the process maximum will be decreased in order to prevent potential access violations.
发表于 2008-1-26 14:26:26 | 显示全部楼层
是这样的,EPOLL能处理的最大描述符数与用户可打开的最大描述符数一致,一般默认1024,可用ulimit -a查看,
修改则用:ulimit -n 5120,但这个修改只有ROOT用户可生效,一般用户不行,必须修改/etc/security/limits.conf,添加二行:
*                soft   nofile          5120
*                hard   nofile          10240
然后重启系统,可打开的最大描述符就变大了,ACE_Dev_Poll_Reactor (5120)也不会出错鸟。
发表于 2011-9-26 20:25:41 | 显示全部楼层
谢谢各位,我也遇到了同样的问题
您需要登录后才可以回帖 登录 | 用户注册

本版积分规则

Archiver|手机版|小黑屋|ACE Developer ( 京ICP备06055248号 )

GMT+8, 2024-11-23 17:27 , Processed in 0.016770 second(s), 5 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表