On Thu, Aug 25, 2005 at 02:58:04PM +0200, Simon Hardy-Francis wrote: > I've been developing with your Perl Event module and came up again a > pitfall which took me some time to solve... maybe you would like to > consider adding some kind of 'warning' or 'hint' into the Event > documentation? > > The pitfall: I set up an io event in order to read from an open > socket. The io event defaulted to automatically 'repeat' and here lies > the pitfall... Much safer is to set repeat => 0 and then inside the > socket read event re-start the event after the sysread(). Why? > Otherwise very many incoming packets can cause Event to backlog read > events faster than the events are processed... e.g. if one does a > little bit (too much) of processing after the sysread(). For the naive > programmer then the first sign of trouble is the socket read event > through-put simpy l dropping as time goes by. I noticed this same > behavior with the latest version of Event on both Windows XP and > Solaris 10. Manually repeating solves the problem.
Dunno, it's hard to change the defaults now. I highly recommend NetServer::ProcessTop for diagnosing this kind of thing. -- Make April 15 just another day, visit http://fairtax.org
signature.asc
Description: Digital signature