Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Benjamin Schmid edited this page Jun 13, 2013 · 2 revisions

Purpose

WebSockets are a new web technology which offers a full-duplex communication channel over a single TCP connection. The WebSocket protocol makes possible more interaction between a browser and a web site, facilitating live content and the creation of real-time games. This is made possible by providing a standardized way for the server to send content to the browser without being solicited by the client, and allowing for messages to be passed back and forth while keeping the connection open

Implementation status

There is a first implementation available from a contributor. This is maintained in the branch feature/websocket and currently integrated into master.

If you have pull-requests/changes related to this feature please start off this feature-branch.

Usage

  • You need to provide custom implementation of ApplicationWebSocket and ApplicationWebSocket.Connection fitting your servlet container
  • In future there is a JSR-356 compliant default implementation planned
    • JSR-356 is already implemented for GlassFish, planned for Jetty 9.1 and Tomcat 8

Implementation notes

In a Code review the following could be reverse engineered/identified

  • The Websocket is only used as channel server to client. For all client to server communication (which is the predominant way) the regular HTTP-based approach is used
  • As soon as via the Java-API an poll interval is enabled (Userinstance.setTaskQueueCallbackInterval()) the implementation of RemoteClient.js either sets up an WebSocket or fallsback to the default polling behaviour (default interval: 500ms)
  • On any message received via the WebSocket from the server, a regular Sync phase is executed (involving a new, parallel HTTP request).
Clone this wiki locally