sae
sae

Reputation: 39

What happens to a thread in when user closes the browser window?

I wrote a website using ASP.NET.

There is a thread in the one page of my website. During the thread running, what happens to thread when user closes the browser window? Does this thread stop being run?

Upvotes: 3

Views: 5076

Answers (3)

mzonerz
mzonerz

Reputation: 1250

Please check this interesting conversation.According to this It will not stop even you closed it. https://forums.asp.net/t/1186025.aspx?What+happens+to+background+process+thread+when+one+closes+the+borwser+window+

Upvotes: 0

Amir Popovich
Amir Popovich

Reputation: 29836

Your server doesn't really know what the client did.

If the client started a request, the server will process it and return a response in any case.

Upvotes: 6

CodeCaster
CodeCaster

Reputation: 151594

I think the question you're asking is not the one you want answered.

The answer to the question "Does asp.net lifecycle continue if I close the browser in the middle of processing?" is "yes". So anything you start from an ASPX page or MVC controller keeps running, even if the client's browser is closed (note that if that is your question, this is a duplicate).

However, the answer to "Can I use threads to carry out long-running jobs on IIS?" is "You can, but you shouldn't, because the thread may be terminated at any time", which you probably don't want.

Upvotes: 3

Related Questions