I am making a server side program using socket programming in java,
which handle multiple requset from the client.
Here client is browser not a client program.
Server accept request from browser and process request using Thread.
in response Web Server sending Continuos data to browser as a streaming
Am getting problem
when user close the broswer or change the tab or minimize the broswer.Then
Server is not able to detect browser states on socket.

why Data is continuosly sending by server program to socket when browser is minimize.
How we can detect browser states on java socket means tab,close or minimize.

i want to know
How apache tomcat detect wheather the browser is open or close or tab change in browser.