Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple long-poll example that doesn't reconnect on timeout #355

Closed
chris-martin opened this issue May 10, 2012 · 3 comments
Closed

Simple long-poll example that doesn't reconnect on timeout #355

chris-martin opened this issue May 10, 2012 · 3 comments

Comments

@chris-martin
Copy link

I have a very small long-polling demonstration here: https://github.com/chris-martin/atmosphere-sandbox/tree/master/empty-long-poll

The AtmosphereHandler does nothing but suspend new requests.

public class NothingAtmosphereHandler implements AtmosphereHandler {
    public void onRequest(AtmosphereResource resource) throws IOException {
        resource.suspend();
    }
    public void onStateChange(AtmosphereResourceEvent event) throws IOException { }
    public void destroy() { }
}

The javascript consists of:

$(function() {
  function log(x) { $('<li/>').text(x).appendTo('body>ul'); }
  $.atmosphere.subscribe({
    url: 'atmosphere',
    transport: 'long-polling',
    onMessage: function() { log('message'); },
    onOpen: function() { log('open'); },
    onError: function() { log('error'); },
    onReconnect: function() { log('reconnect'); }
  });
});

org.atmosphere.cpr.CometSupport.maxInactiveActivity is set to 5000

I would expect this to reconnect every 5 seconds, but it never reconnects. It opens one ajax request and prints "open". The request closes after 5 seconds, and it is never reopened.

Atmosphere 0.9.3

Tested in Google Chrome 15.0.874.106

@jfarcand
Copy link
Member

Looking

@jfarcand
Copy link
Member

In 0.9.4

@jfarcand
Copy link
Member

Fix was (typo in the bug issue)

d970bd2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants