peakzhang 发表于 2007-12-24 23:30:12

Dev_Poll_Reactor运行错误.

ACE_Dev_Poll_Reactor::open failed inside ACE_Dev_Poll_Reactor::CTOR: No such file or directory
请大家帮忙,我是这样创建的:
ACE_Dev_Poll_Reactor dp_reactor(5120)

peakzhang 发表于 2007-12-24 23:30:20

5120是什么?兄弟,问问题要有代码和上下文环境,这样的问题,大家没法解决啊?

peakzhang 发表于 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();

就这样可以了吧.

peakzhang 发表于 2007-12-24 23:30:34

ACE_Dev_Poll_Reactor::ACE_Dev_Poll_Reactor( size_tsize,
intrestart = 0,
ACE_Sig_Handler *= 0,
ACE_Timer_Queue *= 0,
intdisable_notify_pipe = 0,
ACE_Reactor_Notify *notify = 0,
intmask_signals = 1,
ints_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.

cell 发表于 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)也不会出错鸟。

flybird525 发表于 2011-9-26 20:25:41

谢谢各位,我也遇到了同样的问题
页: [1]
查看完整版本: Dev_Poll_Reactor运行错误.