Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-07-2004, 10:43 PM
BlakMonk's Avatar
WebProWorld New Member
 

Join Date: Jul 2003
Location: Montreal
Posts: 14
BlakMonk RepRank 0
Default closing httpd connection, before end of script

Hi,

Is it possible to close the httpd connection and carry on with the rest of the scipt ? I'm currently trying to do it in PHP.

In more details, I want to :

- treat the received parameters
- display stuf
- Close httpd connection so web client can continue
- in the back ground do stuff on the scirpt

Can it be done ?


</Blakmonk>
Reply With Quote
  #2 (permalink)  
Old 04-08-2004, 04:58 PM
Nargule's Avatar
WebProWorld Member
 

Join Date: Nov 2003
Location: Gainesville, FL, USA, Earth, MilkyWay
Posts: 84
Nargule RepRank 0
Default

What scripting language are we talking about here? Or are we just talking in general?

Edit: I see in the original post it says "PHP". I didn't see that before.
__________________
Tom Corwine

Please review my site at http://www.santaslane.com?source=WebPro
and be sure to check out http://www.corwine.tv <--- It's fixed now.
Reply With Quote
  #3 (permalink)  
Old 04-08-2004, 05:11 PM
BlakMonk's Avatar
WebProWorld New Member
 

Join Date: Jul 2003
Location: Montreal
Posts: 14
BlakMonk RepRank 0
Default

Well,

This perticular case, in PHP. I have a way to do it in mod_perl, but the current script I'm working on is in php.


Any ideas ?


</BlakMonk>
Reply With Quote
  #4 (permalink)  
Old 04-08-2004, 06:17 PM
Nargule's Avatar
WebProWorld Member
 

Join Date: Nov 2003
Location: Gainesville, FL, USA, Earth, MilkyWay
Posts: 84
Nargule RepRank 0
Default

Quote:
Originally Posted by BlakMonk
Any ideas ?
Yes, actually. I have been reviewing the php manual and looked at all sorts of output functions and ways of controlling the socket connection. Unfortunatly, I need to experiment with it in order to understand exactly how it works.

There is one solution that's pretty simple - use output buffering to send your output to the browser and close the connection:
Code:
<?php
header("Connection: close");
ob_start();

echo "This is output to browser";

$size=ob_get_length(); 
header("Content-Length: $size");
ob_end_flush();
flush();

// Anything done here is done after output is sent to browser.

?>
Does this make sense? I could be off track here. I still am wondering if the connection to the client is indeed closed with this script.
__________________
Tom Corwine

Please review my site at http://www.santaslane.com?source=WebPro
and be sure to check out http://www.corwine.tv <--- It's fixed now.
Reply With Quote
  #5 (permalink)  
Old 04-09-2004, 11:30 AM
BlakMonk's Avatar
WebProWorld New Member
 

Join Date: Jul 2003
Location: Montreal
Posts: 14
BlakMonk RepRank 0
Default

Hi,

I must admit, that is quite a clever way to do it. But I already use the ob_* functions to trap errors that would happend with "eval"...

Come to think of it... Yes it could work, I'll regroup all my displaying.. and see where it leads...

I'll keep you posted.

</BlakMonk>
Reply With Quote
  #6 (permalink)  
Old 04-12-2004, 04:22 PM
BlakMonk's Avatar
WebProWorld New Member
 

Join Date: Jul 2003
Location: Montreal
Posts: 14
BlakMonk RepRank 0
Default

hi,


I tried it, I had to do some MAJOR modifications on my logic, but it works!

Thank you very very much for your help!


</Blakmonk>
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: , , , , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0