It's not a secret anymore!*
The moose likes Servlets and the fly likes What happens if a browser is shut down after an HTTP request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "What happens if a browser is shut down after an HTTP request" Watch "What happens if a browser is shut down after an HTTP request" New topic
Author

What happens if a browser is shut down after an HTTP request

Pat Rak
Greenhorn

Joined: Oct 02, 2002
Posts: 2
This is probably a kindergarten-level question and I still don't know the answer:
What happens if I type in the address to an HTML page or a servlet, then press enter to submit the HTTP request and then immediately close the browser.
Are the HTTP request and the web server response part of the same session or are they independent?
If I shut down the browser, do the web server /servlet engine:
(a) immediately abort the sending back of the HTML?
OR
(b) they still send the data bytes to a no w invaid destination and the bytes get lost somewhere on the internet?
OR
(3) they send the data bytes to an output stream from their point of view but on the computer system / TCPIP level, nothing goes out of the computer port because the output stream is now dead?
I think the answer is number 3 but not sure.
Thanks,
prak
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
The webserver will not know that the browser has been closed until it tries to send the response, in whic case an exception will be thrown.


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
prak78821
Welcome to the JavaRanch! Please adjust your display name to meet
the JavaRanch Naming Policy. You can change it here.
Thanks!
and welcome to the JavaRanch!
 
wood burning stoves
 
subject: What happens if a browser is shut down after an HTTP request