Solved

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

Posted on 1997-01-08
1
223 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now