Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.1.14

Bug #14924 delayed timer with real socket
Submitted: 2008-10-30 15:29 UTC
From: cortexd Assigned: garrettw
Status: Closed Package: Net_SmartIRC (version 1.0.0)
PHP Version: 5.2.6 OS: Windows XP SP3
Roadmaps: 1.1.0    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 27 - 19 = ?

 
 [2008-10-30 15:29 UTC] cortexd (Alexandre Bouvier)
Description: ------------ with real socket, the timer handler is delayed if someone talks on the channel between two triggers Test script: --------------- <?php require_once 'Net/SmartIRC.php'; class Bot { public function test(Net_SmartIRC $irc) { $irc->message(SMARTIRC_TYPE_CHANNEL, '#cortexd', 'every 10 seconds'); } } $bot = new Bot(); $irc = new Net_SmartIRC(); $irc->setUseSockets(true); $irc->registerTimehandler(10000, $bot, 'test'); $irc->connect('irc.quakenet.org', 6667); $irc->login('SmartIRC', 'Net_SmartIRC', 8, 'smartirc'); $irc->join('#cortexd'); $irc->listen(); Expected result: ---------------- with "$irc->setUseSockets(false);" the result is : [17:08:49] <SmartIRC> every 10 seconds [17:08:59] <SmartIRC> every 10 seconds [17:09:09] <SmartIRC> every 10 seconds [17:09:19] <SmartIRC> every 10 seconds [17:09:29] <SmartIRC> every 10 seconds [17:09:39] <SmartIRC> every 10 seconds [17:09:42] <Cortexd> lol [17:09:44] <Cortexd> lol [17:09:45] <Cortexd> lol [17:09:49] <SmartIRC> every 10 seconds Actual result: -------------- with "$irc->setUseSockets(true);" the result is : [17:11:11] <SmartIRC> every 10 seconds [17:11:21] <SmartIRC> every 10 seconds [17:11:31] <SmartIRC> every 10 seconds [17:11:42] <SmartIRC> every 10 seconds [17:11:52] <SmartIRC> every 10 seconds [17:12:02] <SmartIRC> every 10 seconds [17:12:13] <SmartIRC> every 10 seconds [17:12:23] <SmartIRC> every 10 seconds [17:12:26] <Cortexd> lol [17:12:28] <Cortexd> lol [17:12:29] <Cortexd> lol [17:12:40] <SmartIRC> every 10 seconds [17:12:50] <SmartIRC> every 10 seconds when somebody talks, the timer is delayed !

Comments

 [2014-09-03 15:46 UTC] garrettw (Garrett Whitehorn)
-Status: Open +Status: Verified
 [2014-09-03 20:10 UTC] garrettw (Garrett Whitehorn)
-Status: Verified +Status: Closed -Assigned To: +Assigned To: garrettw
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. Issue had to do with too long of a timeout on socket_select() calls. I removed the *1000 multiplier in that parameter, which isn't a perfect fix, but it should make the timing close enough to not be a noticeable delay to any time handlers. That's pretty much the best fix I can offer on this codebase.