Giter Club home page Giter Club logo

Comments (4)

hiredman avatar hiredman commented on September 26, 2024

I think I was too hasty in assuming just forwarding jetty's onClose wouldn't result in it always getting called, but hard to tell, I haven't found docs that say it is always called, but I found a stackoverflow post that suggested it was (but now have lost the link to that post)

from ring.

weavejester avatar weavejester commented on September 26, 2024

Interesting. I hadn't considered how Jetty would behave under those circumstances. Thank for for bringing it to my attention.

My instinct is to adjust the SPEC and say that on-close is guaranteed to be called if and only if on-open is called, as if the WebSocket is not correctly established and never "opened", it makes no sense for it to then be "closed". This seems the most correct behavior, at least to my mind.

With regard to the Jetty documentation on WebSocketConnectionListener, it says that onWebSocketClose is called when "A Close Event was received." Given that the close status includes events where the WebSocket was closed abnormally - i.e. the TCP connection is terminated without a valid close frame - this implies that once open, a close event is guaranteed. However, I can confirm this on the Jetty mailing list to be sure.

from ring.

weavejester avatar weavejester commented on September 26, 2024

The Jetty users mailing list confirms that on-close is guaranteed to be called if on-open is: https://www.eclipse.org/lists/jetty-users/msg10694.html

from ring.

hiredman avatar hiredman commented on September 26, 2024

interesting, definitely not at all clear to me that "A Close Event was received" in the docs encompasses abnormally termination, but if the jetty mailing list says it is so it must be so. And I didn't realize there was specific reason code to synthesize an onClose call even if no close frame with a reason code came.

from ring.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.