Keep It Simple, Stupid | |
PerlMonks |
Preventing disconnections of an IRC Bot made with Net::IRCby DaWolf (Curate) |
on Dec 06, 2003 at 21:03 UTC ( [id://312803]=perlquestion: print w/replies, xml ) | Need Help?? |
DaWolf has asked for the wisdom of the Perl Monks concerning the following question:
For a little background take a look at Reasons for memory growth on Win32 IRC Bot app.
I've recently discovered that my brave IRC bot is losing it's connection from time to time. Sometimes this fact is directly related with the fact that his lousy creator likes to play heavy consuming on-line games, but sometimes not. A while ago it happened because of the online gaming with the "Ping timeout" message. Good thing is that the perl process keeps running, but it seems that I can't make a correct sub for handling disconnections, so I ask for your help, brothers and sisters. I'll not post the entire code here, it'd be a waste of time, but here are the parts that matters on this: This is the "start_it" sub wich makes the connection: This is the "on_connect" sub: and finally this is the on_disconnect sub: It doesn't log anything, so there are two possibilities here: 1) For some reason it's not calling the "on_disconnect" sub 2) Sleep is "sleeping forever" <UPDATE> I've passed the do_runlog line to be the first at the on_disconnect sub, so I know if it's being called or not. It's not. So it's not a "sleep bug". </UPDATE> I use ActivePerl 5.8.0 on a Windows 2000 Professional machine. Please any thoughts before I get bald from pulling my hair out would be appreciated.
my
($author_nickname, $author_email) = ("DaWolf","erabbott\@terra.com.br")
if ($author_name eq "Er
Galvão Abbott");
Back to
Seekers of Perl Wisdom
|
|