Solved

How to detect if a client browser is still receiving data from a CGI script

Posted on 1997-01-08
1
225 Views
Last Modified: 2013-12-25
I have a situation where it would help if I could detect if a browser is still receiving data from a script. Perhaps STDOUT closes when a browser presses Stop or goes somewhere else? Are there any Perl functions that report on socket/handle status?

Thanks for any help!
0
Comment
Question by:AIRWOLF-mad
1 Comment
 

Accepted Solution

by:
glenk010897 earned 190 total points
ID: 1827533
The problem with the httpd/cgi protocol occurs when a user presses the Stop button on the browser. The web server that is responding to the request is given no immediate notice to abort its process. When a user aborts, the browser simply closes the socket that it had with the web server. The next time the server tries to write some data to that socket, it detects that the socket has been closed.

Yes there is a way - but you will have to change your implementation so that it first checks to see if the socket is still active.

For details plus sample Perl  code see the following page from the Genome Database website.

http://wwwtest.gdb.org/browser/abort/cgiAbort.html
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question