Baggins Posted February 10, 2007 Share Posted February 10, 2007 Hi everyone! I want to use a script that i found to make an msn status thing which will show your status and stuff. The problem is connecting to the msn server every time I call the script is too slow. I have attached the file I am using to connect, and I was wondering if you could help me make it so that it will open the connection, leave it open, and still let other scripts call functions from it. Please help me, this is urgent. Baggins EDIT: also, I don't have SSH only cron jobs [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/37933-keep-msn-script-running/ Share on other sites More sharing options...
ToonMariner Posted February 10, 2007 Share Posted February 10, 2007 have a session var for timestamp of last check and just run every 5 mins or so... Link to comment https://forums.phpfreaks.com/topic/37933-keep-msn-script-running/#findComment-181556 Share on other sites More sharing options...
Baggins Posted February 10, 2007 Author Share Posted February 10, 2007 Sorry, I don't really understand. Whenever status.php is called it connects to the server using msn.class.php and returns an image according to the status. This method is too slow, and I want it to somehow maintain a connection to the server so it will not have to connect every time the script is called. I want the class to sign in as an msn client and when the script is called it will check if the requested user is online. EDIT: I'm gunna make this real simple, I must: 1. Open and keep open connection to msn server. 2. Let other scripts utilize connection through msn.class.php Link to comment https://forums.phpfreaks.com/topic/37933-keep-msn-script-running/#findComment-181557 Share on other sites More sharing options...
Baggins Posted February 10, 2007 Author Share Posted February 10, 2007 bump. Please, I need this by 7:00 Eastren time tonight. It is very important. Link to comment https://forums.phpfreaks.com/topic/37933-keep-msn-script-running/#findComment-181568 Share on other sites More sharing options...
mattd8752 Posted February 10, 2007 Share Posted February 10, 2007 Look into setting timeout to 0 and making php sleep() for x seconds. Also make it so there is no abort even if the user closes the page. This could cause server problems if it can't be closed, so make sure you fopen() a file and check that the file contains a 0 not a 1 (you manually change it to 1 to turn off the script). This script will close after about 400 executions, so you would test to see how long until this script stops working, and set a cron job to run that often. Link to comment https://forums.phpfreaks.com/topic/37933-keep-msn-script-running/#findComment-181616 Share on other sites More sharing options...
Baggins Posted February 10, 2007 Author Share Posted February 10, 2007 Thanks, I finally got it working! Link to comment https://forums.phpfreaks.com/topic/37933-keep-msn-script-running/#findComment-181627 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.