The following program is a minor variant on the sample given in the README with eventmachine-0.8.1. I am running under CentOS 4.5 (kernel 2.6.9-55.0.2.plus.c4) with a ruby-1.8.5 RPM from the CentOS testing repository. When I run it, I find that set_comm_inactivity_timeout doesn''t do anything. That is, if I client opens a connection, it stays open indefinitely. However, if I comment out the line "EventMachine::epoll" then the problem goes away, and timeouts start working. Is this a known issue with epoll? The ''EPOLL'' readme file doesn''t seem to mention it. Regards, Brian. -- 8< --------- require ''rubygems'' require ''eventmachine'' module EchoServer def post_init puts "Connection from #{Socket.unpack_sockaddr_in(get_peername).inspect}" set_comm_inactivity_timeout 60 end def receive_data data send_data ">>>you sent: #{data}" close_connection if data =~ /quit/i end end EventMachine::epoll puts EventMachine::set_descriptor_table_size EventMachine::run { EventMachine::start_server "127.0.0.1", 8081, EchoServer } -- 8< ---------
On 9/14/07, b.candler at pobox.com <b.candler at pobox.com> wrote:> > The following program is a minor variant on the sample given in the README > with eventmachine-0.8.1. I am running under CentOS 4.5 (kernel > 2.6.9-55.0.2.plus.c4) with a ruby-1.8.5 RPM from the CentOS testing > repository. > > When I run it, I find that set_comm_inactivity_timeout doesn''t do > anything. > That is, if I client opens a connection, it stays open indefinitely. > > However, if I comment out the line "EventMachine::epoll" then the problem > goes away, and timeouts start working. > > Is this a known issue with epoll? The ''EPOLL'' readme file doesn''t seem to > mention it.It''s a bug. Thanks for catching. I''ll notify here when it''s fixed. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/eventmachine-talk/attachments/20070914/3a6bca01/attachment.html
On 9/14/07, b.candler at pobox.com <b.candler at pobox.com> wrote:> > The following program is a minor variant on the sample given in the README > with eventmachine-0.8.1. I am running under CentOS 4.5 (kernel > 2.6.9-55.0.2.plus.c4) with a ruby-1.8.5 RPM from the CentOS testing > repository. > > When I run it, I find that set_comm_inactivity_timeout doesn''t do > anything. > That is, if I client opens a connection, it stays open indefinitely. > > However, if I comment out the line "EventMachine::epoll" then the problem > goes away, and timeouts start working. > > Is this a known issue with epoll? The ''EPOLL'' readme file doesn''t seem to > mention it.Fixed. Sync to HEAD revision and let me know if it works for you. It seems to have been left out by oversight, but I''m not 100% sure of that. If there was a reason to leave it out, I can''t remember it now. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/eventmachine-talk/attachments/20070914/f8146242/attachment.html