r3890 - trunk/Docs/server/rcon2irc
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Wed Jul 23 08:34:28 EDT 2008
Author: div0
Date: 2008-07-23 08:34:28 -0400 (Wed, 23 Jul 2008)
New Revision: 3890
Modified:
trunk/Docs/server/rcon2irc/rcon2irc.pl
Log:
hopefully fix high CPU load in connection trouble
Modified: trunk/Docs/server/rcon2irc/rcon2irc.pl
===================================================================
--- trunk/Docs/server/rcon2irc/rcon2irc.pl 2008-07-23 09:22:30 UTC (rev 3889)
+++ trunk/Docs/server/rcon2irc/rcon2irc.pl 2008-07-23 12:34:28 UTC (rev 3890)
@@ -693,13 +693,6 @@
push @tasks, [time() + $time, $sub];
}
-# Build up an IO::Select object for all our channels.
-my $s = IO::Select->new();
-for my $chan(values %channels)
-{
- $s->add($_) for $chan->fds();
-}
-
# On IRC error, delete some data store variables of the connection, and
# reconnect to the IRC server soon (but only if someone is actually playing)
sub irc_error()
@@ -1316,6 +1309,13 @@
# Main loop.
for(;;)
{
+ # Build up an IO::Select object for all our channels.
+ my $s = IO::Select->new();
+ for my $chan(values %channels)
+ {
+ $s->add($_) for $chan->fds();
+ }
+
# wait for something to happen on our sockets, or wait 2 seconds without anything happening there
$s->can_read(2);
my @errors = $s->has_exception(0);
More information about the nexuiz-commits
mailing list