WASdev/sample.async.websockets

Name: sample.async.websockets

Owner: WASdev

Description: This is a collection of samples that illustrate the WebSockets feature in Java EE7 that can be used to make your applications more responsive. #JavaEE7

Created: 2015-03-16 21:56:21.0

Updated: 2017-09-28 10:33:50.0

Pushed: 2017-10-24 18:37:40.0

Homepage:

Size: 202

Language: Java

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Java EE7: WebSockets Build Status

The WebSockets standard defines a full-duplex communication protocol to simplify and streamline long-running communications between a client and a server. The protocol has a well-defined wire format that allows for text or binary messages to be interleaved at will: either side of the connection can send messages at any time, in any order (which is a significant difference from the requirements of Comet or other long-polling mechanisms which require management of several connections to emulate bidirectional communication). The wire format is compact and efficient, making it ideal for small messages.

A WebSocket connection is established by upgrading an existing HTTP connection via an Upgrade handshake. The connection continues to use the original HTTP connection after upgrade, which allows it to work with firewalls and other infrastructure optimized for HTTP traffic; however, HTTP proxy servers may need to be upgraded to understand the WebSocket protocol, especially those that do SSL termination.

This sample contains a few variations to illustrate how to use WebSockets in Java EE7 applications. It goes hand-in-hand with the Introduction to WebSockets session from IBM InterConnect 2015.

This sample also includes a WebSocket client, AnnotatedClientEndpoint, which can be brought into the conversation with either the Echo sample or the Echo async sample by providing client as input.

Getting Started

Browse the code to see what it does, or build and run it yourself:

Once the server has been started, go to http://localhost:9082/websocket/ to interact with the sample. Cross-reference the source to understand what the client side (Java or JavaScript) and server side (Java) are doing.

More on WebSockets
Notice

© Copyright IBM Corporation 2015, 2017.

License
nsed under the Apache License, Version 2.0 (the "License");
may not use this file except in compliance with the License.
may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

ss required by applicable law or agreed to in writing, software
ributed under the License is distributed on an "AS IS" BASIS,
OUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
the License for the specific language governing permissions and
tations under the License.

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.