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

Disconnect Not Called On Tomcat7-Jersey #365

Closed
Flamenco opened this issue May 16, 2012 · 8 comments
Closed

Disconnect Not Called On Tomcat7-Jersey #365

Flamenco opened this issue May 16, 2012 · 8 comments

Comments

@Flamenco
Copy link

For some reason, my Safari and Mobile Safari clients are not being upgraded to web socket. They fall back to comet support. When this happens, my production server never calls 'onDisconnect' for their resource.

On my Jetty dev server they are disconnected every 30 seconds as the init-param specifies, but never on the Tomcat7 server.

I am using:

    <init-param>
        <param-name>org.atmosphere.cpr.CometSupport.maxInactiveActivity</param-name>
        <param-value>30000</param-value>
    </init-param>

All web sockets call 'onDisconnect' immediately.

I have tried variants of the following with no success:

    <init-param>
        <param-name>org.atmosphere.useNative</param-name>
        <param-value>true</param-value>
    </init-param>
    <async-supported>true</async-supported>
@jfarcand
Copy link
Member

Tomcat 7 doesn't support Safari because Safari supports a very old version of the specification. I recommend you use the WebSocketHandshakeFilter.

You can configure it using the

  <init-param>
    <param-name>org.atmosphere.websocket.bannedVersion</param-name>
    <param-value>-1</param-value>
  </init-param>

-1 will force Safari to use long-polling instead.

@jfarcand
Copy link
Member

@Flamenco
Copy link
Author

Hi Jeanfrancois

Thanks for the blog post.

I feel that I should be able to subscribe to a close event and have the option to it have it called and auto disconnect after inactivity, regardless of the implementation or server. It would be nice if the stack had a watchdog mechanism that did some garbage collection. The while point it to write code that runs transparently, yet I keep having to write workarounds.

On May 16, 2012, at 10:24 AM, "Jeanfrancois Arcand" reply@reply.github.com wrote:

Just blogged about possible solution

http://jfarcand.wordpress.com/2012/05/16/safaris-websocket-implementation-and-java-problematic/


Reply to this email directly or view it on GitHub:
#365 (comment)

@jfarcand jfarcand reopened this May 18, 2012
@jfarcand
Copy link
Member

Salut,

good point. Give me 1 hour and I will try to add something. Just to be sure, you want onDisconnect to be called when the connection is "downgraded" to Comet, right?

Thanks for the feedback!

@Flamenco
Copy link
Author

I would actually like to close ANY connection that has not hit the wire after certain period. The clients will automatically reconnect if the server closes, yes?

Manager@MarbleheadMusic.com

On May 18, 2012, at 9:20 AM, "Jeanfrancois Arcand" reply@reply.github.com wrote:

Salut,

good point. Give me 1 hour and I will try to add something. Just to be sure, you want onDisconnect to be called when the connection is "downgraded" to Comet, right?

Thanks for the feedback!


Reply to this email directly or view it on GitHub:
#365 (comment)

@jfarcand
Copy link
Member

Yes, it will. Looking.

@jfarcand
Copy link
Member

Salut, OK, in order to support what you want, I've added #373. The documentation for that feature is here

https://github.com/Atmosphere/atmosphere/wiki/Configuring-Atmosphere-Listener

Thanks for the feedback!

@Flamenco
Copy link
Author

Nice implementation and documentation, Jeanfrancois. I am looking forward to trying it out!

----- Original Message -----

From: "Jeanfrancois Arcand" reply@reply.github.com
To: "Flamenco" spungin@earthlink.net
Sent: Tuesday, May 22, 2012 2:49:13 PM
Subject: Re: [atmosphere] Disconnect Not Called On Tomcat7-Jersey (#365)

Salut, OK, in order to support what you want, I've added #373. The documentation for that feature is here

https://github.com/Atmosphere/atmosphere/wiki/Configuring-Atmosphere-Listener

Thanks for the feedback!


Reply to this email directly or view it on GitHub:
#365 (comment)

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

No branches or pull requests

2 participants