From cb65455ef9a12c75587349ca1018fda463826564 Mon Sep 17 00:00:00 2001 From: div0 Date: Wed, 23 Jul 2008 12:34:28 +0000 Subject: [PATCH] hopefully fix high CPU load in connection trouble git-svn-id: svn://svn.icculus.org/nexuiz/trunk@3890 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- Docs/server/rcon2irc/rcon2irc.pl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Docs/server/rcon2irc/rcon2irc.pl b/Docs/server/rcon2irc/rcon2irc.pl index caffd72ff..edc81e36a 100755 --- a/Docs/server/rcon2irc/rcon2irc.pl +++ b/Docs/server/rcon2irc/rcon2irc.pl @@ -693,13 +693,6 @@ sub schedule($$) 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 @@ schedule sub { # 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); -- 2.39.2