Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7636413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:40:24+00:00 2026-05-31T07:40:24+00:00

In the new Jetty Versions, the WebSocket implementation was divided into several subinterfaces: http://download.eclipse.org/jetty/stable-7/apidocs/org/eclipse/jetty/websocket/WebSocket.html

  • 0

In the new Jetty Versions, the WebSocket implementation was divided into several subinterfaces:

http://download.eclipse.org/jetty/stable-7/apidocs/org/eclipse/jetty/websocket/WebSocket.html

Why was it a good idea to do that?
And what are good use-cases for this separation?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T07:40:26+00:00Added an answer on May 31, 2026 at 7:40 am

    Ok, now that I read more about this issue and implemented something I’ll try to answer it myself.

    The standard WebSocket Interface has only the methods

    onOpen(Connection con)
    

    and

    onClose(int closeCode, String message)
    

    with the Connection you acquire when a WebSocket is opened you can send messages to the Browser (binary, or text).

    So the standard WebSocket Interface is basically just for opening a connection and sending messages to the browser.

    You don’t have to deal there with the other functions, e.g. when messages arrive from the Browser.

    If you want additional functionality there are the other Subinterfaces of WebSocket: Websocket.OnFrame, OnBinaryMessage, OnTextMessage, OnControl

    So now if you want for your WebSocket to handle text messages and binary messages you have to implement it like this:

    class MyWebSocket implements  WebSocket.OnTextMessage, WebSocket.OnBinaryMessage{
        // Implementation
    }
    

    You always only need to implement the interfaces that you need for your task and not all the other functions if they are irrelevant to you. This simplifies the code and reduces code length.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to compile the java class on: http://wiki.eclipse.org/Jetty/Tutorial/Jetty_HelloWorld with Jetty web service.
I have a jetty Http client configured as follows: HttpClient client = new HttpClient();
I downloaded Eclipse for Java EE and Jetty 8.1 and would like to implement
Environment: Java Maven Eclipse Spring Jetty for developemnt JUnit I just started on a
Currently we have a Jetty 7 server started this way //create a new server
I am developing an Eclipse/Equinox based OSGI WebApplication (using embedded Jetty) and using headless
I'm embedding Jetty (version 7.4.5.v20110725) into a java application. I'm serving JSP pages in
I have a datasource set in my Jetty.xml file that looks like this: <New
I created a new gwt project with google application engine in eclipse. But when
I am using Eclipse with Maven. In my pom file i used following Jetty

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.