Hi nml!
thanks for your reply!
I do notice that you've got a loop in your code that iterates 100 times, each time launching an external application that fetches some remote webpage. Due to the single-threaded nature of eggdrop (regardless of whether tcl is threaded or not), your eggdrop will "freeze" until all nested calls (if any) has completed. Especially, launching an external application takes a lot of resources compared to the other code, and doing it this way could very wellcause your eggie to become very sluggish... Do you get any "Timer drift" log-entries?
I
used to get LOTS of timer drifts when trying to use an internal command set to call the external link.. however, I also use catch to either "get or no-get" and this seems to have helped emmensely..
You are
CORRECTin figuring out what the code does.. you should have also noticed that I don't expect any
return of input from the external link.. also, the "catch" basically ignores any fault or timing issue- in turn, this part of the script simply sends out 250 calls to the external link- do or die.. if the external link is ready, all the better, but, if not, no harm done! (the pre-condition elements helps to determine that the external link is "good" before the subroutine is ran anyhow) THAT part of the script runs
FLAWLESSLY! To note, this part of the script will only run if a
specific set of circumstances exists.. these are:
1.. the studio encoder is online AND streaming. ($DetSA) AND...
2.. The Playout Box is online ($DetOT) AND the Playout Cache is empty($DetPL)
3.. The Mode is set to "Auto Play" ($DetAP)
when these conditions are met, then the script will send 250 (in the latest version) "add track $PlayRand to the Playout cache" commands to the remote link and then "start playing"....
The code is quite ingenious, actually.. its smart enough to accept feedback on some parts (when required) once the commands are sent, the code will now STOP sending the commands since $DetPL will now be "on" and the conditions are no longer met.. the code will be ignored untill the 250 entries are dispatched!
about the timing issues...
NOW you're understanding my delimnea!
For this, I call
external commands such as "bot.fch" which is merely the "fetch" command localized just for eggdrop.. the command strings/switches in the call are set up to have very short timeouts and such.. that I have planned the process thread to take 500 ms to complete.. though I give it (up to) 5 seconds to complete.. (I have sucessfully tested it to run at 1 second intervals.. but then a different problem occurs where icecast itself won't close its connections! that problem
still exists, however its a matter of 5 to 20 hung connections versus 60 to 500! why this is? I haven't really determined yet! perhaps something to do with my ISP, Fedora and the way their router handles the connections through its network.. I have the eggdrop using an external fetch to get the info I want then to "drop" the connection- if it closes or not.. I let the Fetch command deal with the connection timout/hung issues... I merely had to come up with a soolution! Remember when you had me trying to use the http package and stuff? I could NOT keep eggdrop from hanging on EVERY connection it opened... and some
indefinately so, the solution was to let FETCH open the connections- and let eggdrop continue on its merry way.. and that works PERFECTLY! no more hung eggdrop! the Bot doesn't even fall out of the channel or fall off IRC.. EVER.. (though the connections still continue to open and stay open....)
As for "having the bot do too much".. hmmmmm "limit" comes to mind again. I have been running the eggdrop- all this time.. and perhaps I DO have it doing too much.. LOL! You're right that its doing a LOT.. from managing the chatroom to rebooting the server at 6 am. .. from switching in the DJ feeds to generating all the dynamic elements of the website.. to even allowing listeners to search the arichive and to place their requests in the playlist for play. Yeah, that eggie's doing a lot!
I have refined the code once again.. and I have the eggie working well with all the code except the search and request.. I took that out untill I can come up with a better way to retrieve results without a parser entry for every line of text.. its
massively NASTY! and I think having 500+ lines of parsers might be too much! was that the culprit? not likely since it WAS working before.. with the code.. the problem came in once I added the image-handling stuff.. and then it broke.. now, the image handler is in place and all is working nicely and fast... I have taken a break from it all- and even took my website down for the time being.. (like you said eariler) for I have been REALLY fustrated- not just with the eggdrop, but a lot of stuff.. but thats going beyond the scope of this thread...
if you're really interested in seeing the whole code, I could pop it up somewhere for you.. though I don't want to release it to the public just yet I'm planning to make a "light" version for the playout system to put on its forums.. but this version now has some "trade secrets" in it.. I have put a lot of time and effort into it.. its not quite hap-hazzardly thrown together.
-DjZ-
