ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perlex
perlex
RE: How to get Connection: Keep-Alive from IIS
by jurgen other posts by this author
Oct 27 2006 11:21AM messages near this date
RE: How to get Connection: Keep-Alive from IIS | Win2003 server - permission
SERVICES Hello again,

Thanks for the quick reply, Chris. Unfortunately, the code doesn't
really seem to do the trick. It nicely gets unbuffered output working,
and keeping the connection alive within the scripts execution time, but
it doesn't prevent the IIS from closing the TCP/IP connection once the
script is finished. 

(When I run this example with PerlEx and CGI headers enabled the IIS
does indeed add a Connection: close there, indicating that it will shut
down the connection once the script is done.)

So, I'm still looking for answers regarding how to, if at all possible,
get Connection: Keep-Alive to work.

/JW

>  -----Original Message-----
>  From: Chris O [mailto:oror.list@[...].com] 
>  Sent: den 27 oktober 2006 15:17
>  To: jurgen@jwenzel.se; perlex@[...].com
>  Subject: RE: How to get Connection: Keep-Alive from IIS
>  
>  
>  
>  > Does anyone know whether you can get this to work on IIS 
>  and if so, what
>  needs to be done?
>  
>  > /JW
>  
>  
>  This was posted a while back. It works on Apache and IIS.
>  
>  - Chris
>  
>  
>  
>  #!/usr/bin/perl
>  
>  $|=1;
>  use CGI qw(:standard);
>  
>  $cancel=0;
>  $SIG{'__DIE__'}=sub {$cancel=1;};
>  
>  print "Content-type: text/html\n",
>    "Connection: keep-alive\n\n",
>    "<html><body>\n",
>    "I am doing something on server ";
>  for(1..3)
>  {
>    for(1..5)
>    {
>      print '*',' 'x255;
>      sleep 2;
>    }
>    sleep 2;
>    print "<br>I still work...\n";
>    print "<br>Stop button pressed<br>\n" if($cancel==1);
>  }
>  print "<br>OK - That's all\n",
>    "</body></html>\n";
>  
>  
Thread:
jurgen
Chris O
jurgen

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved