1

I have created simple server push using atmosphere run time in tomcat 7.0.23 I am able to get message(data) from server in browser, now the problem is whenever i am closing the connection(browser), the servlet keeps broadcasting. I have referred the atmosphere white paper. It's mention that Auto‐detect
client
remote
disconnection
 is supported in tomcat 7 by configuring the 
CometConnectionManagerValve
 Valve
 which i already did.

<Engine> <Valve className="org.apache.catalina.valves.CometConnectionManagerValve"/><Engine>

but nothing is happend.. Here is my onStateChange method.

public void onStateChange(AtmosphereResourceEvent<HttpServletRequest, HttpServletResponse> event)
        throws IOException {

    System.out.println("###############################ON STATE CHANGE#######################################");

    System.out.println("BroadCaster Id : "+event.getResource().getBroadcaster().getID());

    if(event.isCancelled()) {
        System.out.println("Cancelled....");
        event.getResource().getBroadcaster().destroy();
    }
}

I have also created AtmosphereResourceEventListener to keep track of various event. again its not invoking any method..

Please help. Thanks in advance.

4

0 回答 0