Coder Social home page Coder Social logo

Client close notification about servlet HOT 11 OPEN

jakartaee avatar jakartaee commented on August 12, 2024 6
Client close notification

from servlet.

Comments (11)

glassfishrobot avatar glassfishrobot commented on August 12, 2024 6

@glassfishrobot Commented
rstoyanchev said:
As one example of why this matters consider the SockJS protocol that provides HTTP fallback options for WebSocket.

The protocol does not define any client-side "close" frame. It expects the server will detect when the HTTP connection is closed and indeed a variety of server-side implementations in a range of languages (node, erlang, python, ruby) do.

A Java implementation – with Servlet 3 async for the long polling or HTTP streaming – however cannot detect when a client has gone away. This is a very fundamental, missing feature that puts Java Servlet-based implementations at a significant disadvantage.

from servlet.

glassfishrobot avatar glassfishrobot commented on August 12, 2024 2

@glassfishrobot Commented
ash2k said:
Because this feature is missing it is not possible to stop resource consuming computations on server if client disconnects. Please, see this ticket for example https://sourceforge.net/apps/trac/bigdata/ticket/694

from servlet.

glassfishrobot avatar glassfishrobot commented on August 12, 2024 1

@glassfishrobot Commented
@shingwaichan said:
There is no way to know when the socket is closed from SE API.

from servlet.

glassfishrobot avatar glassfishrobot commented on August 12, 2024 1

@glassfishrobot Commented
jfarcand said:
I disagree. Any NIO layer can detect when the underlying connection is getting closed. Look at Grizzly/Tomcat NIO/Netty, they all able to handle that case.

from servlet.

gregw avatar gregw commented on August 12, 2024 1

I think such a new API is out of scope for 5.1... however we should clarify our existing APIs in similar circumstances such as clarifications of HTTP/2 behaviour with regards to async calls to onError etc. discussed in #256

from servlet.

glassfishrobot avatar glassfishrobot commented on August 12, 2024

from servlet.

glassfishrobot avatar glassfishrobot commented on August 12, 2024

@glassfishrobot Commented
Reported by jitu

from servlet.

glassfishrobot avatar glassfishrobot commented on August 12, 2024

@glassfishrobot Commented
@mpotociar said:
onDisconnect(...) would be a better name IMO. Also, if that's not possible due to the lack of JavaSE Socket API, should it be clarified that onError(...) could be used for that purpose?

from servlet.

glassfishrobot avatar glassfishrobot commented on August 12, 2024

@glassfishrobot Commented
@shingwaichan said:
java.nio.channels.Channel#isOpen tests whether or not the channel is open.
So, we will revisit the issue.

from servlet.

glassfishrobot avatar glassfishrobot commented on August 12, 2024

@glassfishrobot Commented
rstoyanchev said:
Adding a link to a discussion on Tomcat's user list.

from servlet.

glassfishrobot avatar glassfishrobot commented on August 12, 2024

@glassfishrobot Commented
This issue was imported from java.net JIRA SERVLET_SPEC-44

from servlet.

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.