SlideShare a Scribd company logo
WEB SOCKETS
      CURRENT STATE
   FOR JAVA DEVELOPERS
Web SOCKETS
      CURRENT STATE
   FOR JAVA DEVELOPERS


       PRESENTED
           BY


        VIKTOR
        GAMOV
WEB SOCKETS
                           AGENDA



BIT OF       MEET              WEBSOCKETS       Q&A
HISTORY   THE WEBSOCKETS            IN ACTION   SESSION



                                                 ?
OPTIONS FOR “REALTIME” WEB




  “LEGACY” WEB
      POLLING                           LONG-POLLING                           STEAMING
Browser sends HTTP requests at      Browser sends a request to the
regular intervals and               server and the server keeps the     Browser sends a complete
immediately receives a              request open for a set period       request, but the server sends
response. However, real- time       of time. If a notification is        and maintains an open
data is often not that              received within that period, a      response that is continuously
predictable, making                 response containing the             updated and kept open
unnecessary requests                message is sent to the client. If   indefinitely (or for a set period
inevitable and as a result,         a notification is not received       of time)
many connections are opened         within the set time period, the
and closed needlessly in low-       server sends a response to
message-rate situations             terminate the open request.
WHAT IS WEBSOCKET




“Reducing kilobytes of data to 2 bytes... and reducing latency from 150ms to 50
ms is far more than marginal. In fact, these two factors alone are enough to make
WebSocket seriously interesting...”


                www.ietf.org/mail-archive/web/hybi/current/msg00784.html
WHAT IS WEBSOCKETS?




       WEB SOCKET
STANDARD PROTOCOL              CLIENT-SIDE API         SERVER-SIDE API

 Websocket is a              HTML5 specification       True real-time server
 standardized technology     introduces WebSocket     updates. Expected large
 (described in RFC6455)      client side object. No   penetration in Java
 to support low-overhead     plugin required.         world with upcoming
 bidirectional traffic from                            JavaEE 7 spec and
 your Web browser.                                    JSR-356
WEBSOCKET HANDSHAKE



           To Start full-duplex communication client should send
           UPGRADE request




   1                    2                       3                     4
  SEND                RECEIVE                 CHANGE                LISTEN
UPGRADE             UPGRADE               READYSTATE               MESSAGE
 REQUEST              RESPONSE                TO OPEN                EVENT
DEMO




HANDSHAKE
  DEMO
WEBSOCKET INTERFACE

[Constructor(DOMString	
  url,	
  optional	
  (DOMString	
  or	
  DOMString[])	
  protocols)]
interface	
  WebSocket	
  :	
  EventTarget	
  {
	
  	
  readonly	
  attribute	
  DOMString	
  url;

	
  	
  //	
  ready	
  state
	
  	
  const	
  unsigned	
  short	
  CONNECTING	
  =	
  0;
	
  	
  const	
  unsigned	
  short	
  OPEN	
  =	
  1;
	
  	
  const	
  unsigned	
  short	
  CLOSING	
  =	
  2;
	
  	
  const	
  unsigned	
  short	
  CLOSED	
  =	
  3;
	
  	
  readonly	
  attribute	
  unsigned	
  short	
  readyState;
	
  	
  readonly	
  attribute	
  unsigned	
  long	
  bufferedAmount;

	
  	
  //	
  networking
	
  	
  [TreatNonCallableAsNull]	
  attribute	
  Function?	
  onopen;
	
  	
  [TreatNonCallableAsNull]	
  attribute	
  Function?	
  onerror;
	
  	
  [TreatNonCallableAsNull]	
  attribute	
  Function?	
  onclose;
	
  	
  readonly	
  attribute	
  DOMString	
  extensions;
	
  	
  readonly	
  attribute	
  DOMString	
  protocol;
	
  	
  void	
  close([Clamp]	
  optional	
  unsigned	
  short	
  code,	
  optional	
  DOMString	
  reason);

	
  	
  //	
  messaging
	
  	
  [TreatNonCallableAsNull]	
  attribute	
  Function?	
  onmessage;
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  attribute	
  DOMString	
  binaryType;
	
  	
  void	
  send(DOMString	
  data);
	
  	
  void	
  send(ArrayBufferView	
  data);
	
  	
  void	
  send(Blob	
  data);
};
CLIENT-SIDE WEBSOCKET API

var	
  ws;
if	
  (window.WebSocket)	
  {
	
  	
  	
  	
  output("WebSocket	
  supported	
  in	
  your	
  browser");
	
  	
  	
  	
  ws	
  =	
  new	
  WebSocket("ws://www.websockets.org");

	
  	
  	
  	
  //	
  Set	
  event	
  handlers.
	
  	
  	
  	
  ws.onopen	
  =	
  function	
  ()	
  {
	
  	
  	
  	
  	
  	
  	
  	
  output("onopen");
	
  	
  	
  	
  };
	
  	
  	
  	
  ws.onmessage	
  =	
  function	
  (e)	
  {
	
  	
  	
  	
  	
  	
  	
  	
  //	
  e.data	
  contains	
  received	
  string.
	
  	
  	
  	
  	
  	
  	
  	
  output("echo	
  from	
  server	
  :	
  "	
  +	
  e.data);
	
  	
  	
  	
  };
	
  	
  	
  	
  ws.onclose	
  =	
  function	
  ()	
  {
	
  	
  	
  	
  	
  	
  	
  	
  output("onclose");
	
  	
  	
  	
  };
	
  	
  	
  	
  ws.onerror	
  =	
  function	
  ()	
  {
	
  	
  	
  	
  	
  	
  	
  	
  output("onerror");
	
  	
  	
  	
  };

}
else	
  {output("WebSocket	
  not	
  supported	
  in	
  your	
  browser");}
JAVA EE 7 SERVER-SIDE API



package	
  org.javaee.glassfishwebsocket;

import	
  org.glassfish.websocket.api.annotations.WebSocket;
import	
  org.glassfish.websocket.api.annotations.WebSocketMessage;

@WebSocket(path	
  =	
  "/echo")
public	
  class	
  EchoBean	
  {
	
  	
  	
  	
  @WebSocketMessage
	
  	
  	
  	
  public	
  String	
  echo(String	
  message)	
  {
	
  	
  	
  	
  	
  	
  	
  	
  System.out.println("#####################	
  Message	
  received");
	
  	
  	
  	
  	
  	
  	
  	
  return	
  message	
  +	
  "	
  (from	
  your	
  server)";
	
  	
  	
  	
  }
}
TOMCAT 7.0.29 SERVER-SIDE API




SHOW
  THE
 CODE
Not enough room for code in this slide ;-)
PROGRAMMING WEBSOCKETS




Client-side frameworks

✦jquery.socket.js
 ✦https://github.com/flowersinthesand/jquery-socket/wiki
✦atmosphere.js
  ✦https://github.com/Atmosphere/atmosphere/wiki/jQuery.atmosphere.js-API
✦socket.io
WEBSOCKET SUPPORT



JAVA-based Web servers with native support.
The WebServer has API for WebSocket

✦Netty 3.3.x
✦Jetty 7.x, 8.x
✦Glassfish 3.1.2
✦Tomcat 7.0.27
WHAT SHOULD WE DO?




   WE CAN DO IT!
WHAT IS ATMOSPHERE
Atmosphere
https://github.com/Atmosphere/atmosphere/


✦portable framework for
 ✦long-polling
 ✦Streaming
 ✦Server-Send Events
 ✦WebSockets
✦can auto select best transport
✦abstracting from actual underlying container
mechanism
THINKING ABOUT USE CASES




               ?
USE CASE
                      OUR CLIENTS



WebSockets really shine with following applications:

✦Live trading/sports ticker
✦Controlling medical equipment over the web
✦Chat applications
✦Multiplayer online games
✦Realtime updating social streams
BUNCH OF USEFUL LINKS



✦http://www.w3.org/TR/websockets/ MUST!
✦http://tools.ietf.org/html/rfc6455 MUST!
✦http://tomcat.apache.org/tomcat-7.0-doc/web-socket-howto.html
✦http://websocket-sdk.java.net/Introduction.html
✦https://github.com/Atmosphere/atmosphere/wiki/Supported-
WebServers-and-Browsers
✦http://autobahn.ws/testsuite
Q AND A




Q&A
Put your questions
CONTACT US




             WWW.FARATASYSTEMS.COM

             INFO@FARATASYSTEMS.COM
FIND ME




            TWITTER                 GITHUB
WWW.TWITTER.COM/GAMUSSA             WWW.GITHUB.COM/GAMUSSA
THANK YOU




THANK YOU
      FOR YOUR ATTENTION




 HTTP://WWW.FARATASYSTEMS.COM

More Related Content

What's hot

Large scale web socket system with AWS and Web socket
Large scale web socket system with AWS and Web socketLarge scale web socket system with AWS and Web socket
Large scale web socket system with AWS and Web socket
Le Kien Truc
 
HTML5 WebSocket: The New Network Stack for the Web
HTML5 WebSocket: The New Network Stack for the WebHTML5 WebSocket: The New Network Stack for the Web
HTML5 WebSocket: The New Network Stack for the Web
Peter Lubbers
 
Building Next Generation Real-Time Web Applications using Websockets
Building Next Generation Real-Time Web Applications using WebsocketsBuilding Next Generation Real-Time Web Applications using Websockets
Building Next Generation Real-Time Web Applications using Websockets
Naresh Chintalcheru
 
Introduction to WebSockets
Introduction to WebSocketsIntroduction to WebSockets
Introduction to WebSockets
Gunnar Hillert
 
WebSockets with Spring 4
WebSockets with Spring 4WebSockets with Spring 4
WebSockets with Spring 4
Sergi Almar i Graupera
 
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
Peter Lubbers
 
Spring + WebSocket integration
Spring + WebSocket integrationSpring + WebSocket integration
Spring + WebSocket integration
Oleksandr Semenov
 
Nuts and Bolts of WebSocket Devoxx 2014
Nuts and Bolts of WebSocket Devoxx 2014Nuts and Bolts of WebSocket Devoxx 2014
Nuts and Bolts of WebSocket Devoxx 2014
Arun Gupta
 
Asynchronous Web Programming with HTML5 WebSockets and Java
Asynchronous Web Programming with HTML5 WebSockets and JavaAsynchronous Web Programming with HTML5 WebSockets and Java
Asynchronous Web Programming with HTML5 WebSockets and Java
James Falkner
 
Using WebSockets with ColdFusion
Using WebSockets with ColdFusionUsing WebSockets with ColdFusion
Using WebSockets with ColdFusioncfjedimaster
 
Php push notifications
Php push notificationsPhp push notifications
Php push notifications
Mohammed Shurrab
 
Realtime web application with java
Realtime web application with javaRealtime web application with java
Realtime web application with java
JeongHun Byeon
 
Grizzly 20080925 V2
Grizzly 20080925 V2Grizzly 20080925 V2
Grizzly 20080925 V2
Eduardo Pelegri-Llopart
 
Web sockets in Java
Web sockets in JavaWeb sockets in Java
Web sockets in Java
Pance Cavkovski
 
WebSocket protocol
WebSocket protocolWebSocket protocol
WebSocket protocol
Kensaku Komatsu
 
Google Chromebook for the Enterprise: Yeah or Meh?
Google Chromebook for the Enterprise: Yeah or Meh?Google Chromebook for the Enterprise: Yeah or Meh?
Google Chromebook for the Enterprise: Yeah or Meh?
Ericom Software
 
COMET in Plone
COMET in PloneCOMET in Plone
COMET in Plone
Christian Scholz
 

What's hot (20)

Ws
WsWs
Ws
 
Large scale web socket system with AWS and Web socket
Large scale web socket system with AWS and Web socketLarge scale web socket system with AWS and Web socket
Large scale web socket system with AWS and Web socket
 
HTML5 WebSocket: The New Network Stack for the Web
HTML5 WebSocket: The New Network Stack for the WebHTML5 WebSocket: The New Network Stack for the Web
HTML5 WebSocket: The New Network Stack for the Web
 
Building Next Generation Real-Time Web Applications using Websockets
Building Next Generation Real-Time Web Applications using WebsocketsBuilding Next Generation Real-Time Web Applications using Websockets
Building Next Generation Real-Time Web Applications using Websockets
 
Introduction to WebSockets
Introduction to WebSocketsIntroduction to WebSockets
Introduction to WebSockets
 
Intro to WebSockets
Intro to WebSocketsIntro to WebSockets
Intro to WebSockets
 
J web socket
J web socketJ web socket
J web socket
 
WebSockets with Spring 4
WebSockets with Spring 4WebSockets with Spring 4
WebSockets with Spring 4
 
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
 
Spring + WebSocket integration
Spring + WebSocket integrationSpring + WebSocket integration
Spring + WebSocket integration
 
Nuts and Bolts of WebSocket Devoxx 2014
Nuts and Bolts of WebSocket Devoxx 2014Nuts and Bolts of WebSocket Devoxx 2014
Nuts and Bolts of WebSocket Devoxx 2014
 
Asynchronous Web Programming with HTML5 WebSockets and Java
Asynchronous Web Programming with HTML5 WebSockets and JavaAsynchronous Web Programming with HTML5 WebSockets and Java
Asynchronous Web Programming with HTML5 WebSockets and Java
 
Using WebSockets with ColdFusion
Using WebSockets with ColdFusionUsing WebSockets with ColdFusion
Using WebSockets with ColdFusion
 
Php push notifications
Php push notificationsPhp push notifications
Php push notifications
 
Realtime web application with java
Realtime web application with javaRealtime web application with java
Realtime web application with java
 
Grizzly 20080925 V2
Grizzly 20080925 V2Grizzly 20080925 V2
Grizzly 20080925 V2
 
Web sockets in Java
Web sockets in JavaWeb sockets in Java
Web sockets in Java
 
WebSocket protocol
WebSocket protocolWebSocket protocol
WebSocket protocol
 
Google Chromebook for the Enterprise: Yeah or Meh?
Google Chromebook for the Enterprise: Yeah or Meh?Google Chromebook for the Enterprise: Yeah or Meh?
Google Chromebook for the Enterprise: Yeah or Meh?
 
COMET in Plone
COMET in PloneCOMET in Plone
COMET in Plone
 

Viewers also liked

Functional UI testing of Adobe Flex RIA
Functional UI testing of Adobe Flex RIAFunctional UI testing of Adobe Flex RIA
Functional UI testing of Adobe Flex RIA
Viktor Gamov
 
JavaOne 2013: «Java and JavaScript - Shaken, Not Stirred»
JavaOne 2013: «Java and JavaScript - Shaken, Not Stirred»JavaOne 2013: «Java and JavaScript - Shaken, Not Stirred»
JavaOne 2013: «Java and JavaScript - Shaken, Not Stirred»
Viktor Gamov
 
Testing Flex RIAs for NJ Flex user group
Testing Flex RIAs for NJ Flex user groupTesting Flex RIAs for NJ Flex user group
Testing Flex RIAs for NJ Flex user group
Viktor Gamov
 
[Jfokus] Riding the Jet Streams
[Jfokus] Riding the Jet Streams[Jfokus] Riding the Jet Streams
[Jfokus] Riding the Jet Streams
Viktor Gamov
 
[JokerConf] Верхом на реактивных стримах, 10/13/2016
[JokerConf] Верхом на реактивных стримах, 10/13/2016[JokerConf] Верхом на реактивных стримах, 10/13/2016
[JokerConf] Верхом на реактивных стримах, 10/13/2016
Viktor Gamov
 
[NYJavaSig] Riding the Distributed Streams - Feb 2nd, 2017
[NYJavaSig] Riding the Distributed Streams - Feb 2nd, 2017[NYJavaSig] Riding the Distributed Streams - Feb 2nd, 2017
[NYJavaSig] Riding the Distributed Streams - Feb 2nd, 2017
Viktor Gamov
 
[Codemash] Caching Made "Bootiful"!
[Codemash] Caching Made "Bootiful"![Codemash] Caching Made "Bootiful"!
[Codemash] Caching Made "Bootiful"!
Viktor Gamov
 
[OracleCode - SF] Distributed caching for your next node.js project
[OracleCode - SF] Distributed caching for your next node.js project[OracleCode - SF] Distributed caching for your next node.js project
[OracleCode - SF] Distributed caching for your next node.js project
Viktor Gamov
 
[OracleCode SF] In memory analytics with apache spark and hazelcast
[OracleCode SF] In memory analytics with apache spark and hazelcast[OracleCode SF] In memory analytics with apache spark and hazelcast
[OracleCode SF] In memory analytics with apache spark and hazelcast
Viktor Gamov
 
Creating your own private Download Center with Bintray
Creating your own private Download Center with Bintray Creating your own private Download Center with Bintray
Creating your own private Download Center with Bintray
Baruch Sadogursky
 
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at Oracle Code SF...
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at Oracle Code SF...DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at Oracle Code SF...
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at Oracle Code SF...
Baruch Sadogursky
 
Java 8 Puzzlers [as presented at OSCON 2016]
Java 8 Puzzlers [as presented at  OSCON 2016]Java 8 Puzzlers [as presented at  OSCON 2016]
Java 8 Puzzlers [as presented at OSCON 2016]
Baruch Sadogursky
 
Spring Data: New approach to persistence
Spring Data: New approach to persistenceSpring Data: New approach to persistence
Spring Data: New approach to persistence
Oleksiy Rezchykov
 
Morning at Lohika 2nd anniversary
Morning at Lohika 2nd anniversaryMorning at Lohika 2nd anniversary
Morning at Lohika 2nd anniversary
Taras Matyashovsky
 
Confession of an Engineer
Confession of an EngineerConfession of an Engineer
Confession of an Engineer
Taras Matyashovsky
 
Couchbase Sydney meetup #1 Couchbase Architecture and Scalability
Couchbase Sydney meetup #1    Couchbase Architecture and ScalabilityCouchbase Sydney meetup #1    Couchbase Architecture and Scalability
Couchbase Sydney meetup #1 Couchbase Architecture and Scalability
Karthik Babu Sekar
 
Patterns and antipatterns in Docker image lifecycle @ DevOpsDays Charlotte 2017
Patterns and antipatterns in Docker image lifecycle @ DevOpsDays Charlotte 2017Patterns and antipatterns in Docker image lifecycle @ DevOpsDays Charlotte 2017
Patterns and antipatterns in Docker image lifecycle @ DevOpsDays Charlotte 2017
Baruch Sadogursky
 
Javaeeconf 2016 how to cook apache kafka with camel and spring boot
Javaeeconf 2016 how to cook apache kafka with camel and spring bootJavaeeconf 2016 how to cook apache kafka with camel and spring boot
Javaeeconf 2016 how to cook apache kafka with camel and spring boot
Ivan Vasyliev
 
Patterns and antipatterns in Docker image lifecycle as was presented at Oracl...
Patterns and antipatterns in Docker image lifecycle as was presented at Oracl...Patterns and antipatterns in Docker image lifecycle as was presented at Oracl...
Patterns and antipatterns in Docker image lifecycle as was presented at Oracl...
Baruch Sadogursky
 
Patterns and antipatterns in Docker image lifecycle as was presented at Scale...
Patterns and antipatterns in Docker image lifecycle as was presented at Scale...Patterns and antipatterns in Docker image lifecycle as was presented at Scale...
Patterns and antipatterns in Docker image lifecycle as was presented at Scale...
Baruch Sadogursky
 

Viewers also liked (20)

Functional UI testing of Adobe Flex RIA
Functional UI testing of Adobe Flex RIAFunctional UI testing of Adobe Flex RIA
Functional UI testing of Adobe Flex RIA
 
JavaOne 2013: «Java and JavaScript - Shaken, Not Stirred»
JavaOne 2013: «Java and JavaScript - Shaken, Not Stirred»JavaOne 2013: «Java and JavaScript - Shaken, Not Stirred»
JavaOne 2013: «Java and JavaScript - Shaken, Not Stirred»
 
Testing Flex RIAs for NJ Flex user group
Testing Flex RIAs for NJ Flex user groupTesting Flex RIAs for NJ Flex user group
Testing Flex RIAs for NJ Flex user group
 
[Jfokus] Riding the Jet Streams
[Jfokus] Riding the Jet Streams[Jfokus] Riding the Jet Streams
[Jfokus] Riding the Jet Streams
 
[JokerConf] Верхом на реактивных стримах, 10/13/2016
[JokerConf] Верхом на реактивных стримах, 10/13/2016[JokerConf] Верхом на реактивных стримах, 10/13/2016
[JokerConf] Верхом на реактивных стримах, 10/13/2016
 
[NYJavaSig] Riding the Distributed Streams - Feb 2nd, 2017
[NYJavaSig] Riding the Distributed Streams - Feb 2nd, 2017[NYJavaSig] Riding the Distributed Streams - Feb 2nd, 2017
[NYJavaSig] Riding the Distributed Streams - Feb 2nd, 2017
 
[Codemash] Caching Made "Bootiful"!
[Codemash] Caching Made "Bootiful"![Codemash] Caching Made "Bootiful"!
[Codemash] Caching Made "Bootiful"!
 
[OracleCode - SF] Distributed caching for your next node.js project
[OracleCode - SF] Distributed caching for your next node.js project[OracleCode - SF] Distributed caching for your next node.js project
[OracleCode - SF] Distributed caching for your next node.js project
 
[OracleCode SF] In memory analytics with apache spark and hazelcast
[OracleCode SF] In memory analytics with apache spark and hazelcast[OracleCode SF] In memory analytics with apache spark and hazelcast
[OracleCode SF] In memory analytics with apache spark and hazelcast
 
Creating your own private Download Center with Bintray
Creating your own private Download Center with Bintray Creating your own private Download Center with Bintray
Creating your own private Download Center with Bintray
 
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at Oracle Code SF...
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at Oracle Code SF...DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at Oracle Code SF...
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at Oracle Code SF...
 
Java 8 Puzzlers [as presented at OSCON 2016]
Java 8 Puzzlers [as presented at  OSCON 2016]Java 8 Puzzlers [as presented at  OSCON 2016]
Java 8 Puzzlers [as presented at OSCON 2016]
 
Spring Data: New approach to persistence
Spring Data: New approach to persistenceSpring Data: New approach to persistence
Spring Data: New approach to persistence
 
Morning at Lohika 2nd anniversary
Morning at Lohika 2nd anniversaryMorning at Lohika 2nd anniversary
Morning at Lohika 2nd anniversary
 
Confession of an Engineer
Confession of an EngineerConfession of an Engineer
Confession of an Engineer
 
Couchbase Sydney meetup #1 Couchbase Architecture and Scalability
Couchbase Sydney meetup #1    Couchbase Architecture and ScalabilityCouchbase Sydney meetup #1    Couchbase Architecture and Scalability
Couchbase Sydney meetup #1 Couchbase Architecture and Scalability
 
Patterns and antipatterns in Docker image lifecycle @ DevOpsDays Charlotte 2017
Patterns and antipatterns in Docker image lifecycle @ DevOpsDays Charlotte 2017Patterns and antipatterns in Docker image lifecycle @ DevOpsDays Charlotte 2017
Patterns and antipatterns in Docker image lifecycle @ DevOpsDays Charlotte 2017
 
Javaeeconf 2016 how to cook apache kafka with camel and spring boot
Javaeeconf 2016 how to cook apache kafka with camel and spring bootJavaeeconf 2016 how to cook apache kafka with camel and spring boot
Javaeeconf 2016 how to cook apache kafka with camel and spring boot
 
Patterns and antipatterns in Docker image lifecycle as was presented at Oracl...
Patterns and antipatterns in Docker image lifecycle as was presented at Oracl...Patterns and antipatterns in Docker image lifecycle as was presented at Oracl...
Patterns and antipatterns in Docker image lifecycle as was presented at Oracl...
 
Patterns and antipatterns in Docker image lifecycle as was presented at Scale...
Patterns and antipatterns in Docker image lifecycle as was presented at Scale...Patterns and antipatterns in Docker image lifecycle as was presented at Scale...
Patterns and antipatterns in Docker image lifecycle as was presented at Scale...
 

Similar to WebSockets: The Current State of the Most Valuable HTML5 API for Java Developers

Web-Socket
Web-SocketWeb-Socket
Websocket
WebsocketWebsocket
Websocket
艾鍗科技
 
Enhancing Mobile User Experience with WebSocket
Enhancing Mobile User Experience with WebSocketEnhancing Mobile User Experience with WebSocket
Enhancing Mobile User Experience with WebSocket
Mauricio "Maltron" Leal
 
Real-Time with Flowdock
Real-Time with FlowdockReal-Time with Flowdock
Real-Time with Flowdock
Flowdock
 
Signal r
Signal rSignal r
Signal r
Vasilios Kuznos
 
Web sockets - Pentesting
Web sockets - Pentesting Web sockets - Pentesting
Web sockets - Pentesting
Vandana Verma
 
Jwebsocketmobiletechcon2010en 100912071225 Phpapp01
Jwebsocketmobiletechcon2010en 100912071225 Phpapp01Jwebsocketmobiletechcon2010en 100912071225 Phpapp01
Jwebsocketmobiletechcon2010en 100912071225 Phpapp01
purans
 
jWebSocket MobileTechCon 2010 - WebSockets on Android, Symbian and BlackBerry
jWebSocket MobileTechCon 2010 - WebSockets on Android, Symbian and BlackBerryjWebSocket MobileTechCon 2010 - WebSockets on Android, Symbian and BlackBerry
jWebSocket MobileTechCon 2010 - WebSockets on Android, Symbian and BlackBerry
Innotrade GmbH, jWebSocket.org, Alexander Schulze
 
KSDG-iSlide App 開發心得分享
KSDG-iSlide App 開發心得分享KSDG-iSlide App 開發心得分享
KSDG-iSlide App 開發心得分享
Chia Wei Tsai
 
Ecom 1
Ecom 1Ecom 1
Socket.io
Socket.ioSocket.io
Socket.io
Diego Pacheco
 
Real time web apps
Real time web appsReal time web apps
Real time web apps
Sepehr Rasouli
 
WebSocket Perspectives and Vision for the Future
WebSocket Perspectives and Vision for the FutureWebSocket Perspectives and Vision for the Future
WebSocket Perspectives and Vision for the Future
Frank Greco
 
Connected Web Systems
Connected Web SystemsConnected Web Systems
Connected Web Systems
Damir Dobric
 
Data power v7 update - Ravi Katikala
Data power v7 update - Ravi KatikalaData power v7 update - Ravi Katikala
Data power v7 update - Ravi Katikalafloridawusergroup
 
Real time Communication with Signalr (Android Client)
Real time Communication with Signalr (Android Client)Real time Communication with Signalr (Android Client)
Real time Communication with Signalr (Android Client)Deepak Gupta
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSockets
Gonzalo Ayuso
 
DevCon5 (July 2014) - Acision SDK
DevCon5 (July 2014) - Acision SDKDevCon5 (July 2014) - Acision SDK
DevCon5 (July 2014) - Acision SDK
Crocodile WebRTC SDK and Cloud Signalling Network
 
Realizzare applicazioni Web con WebSocket, by Simone Bordet
Realizzare applicazioni Web con WebSocket, by Simone BordetRealizzare applicazioni Web con WebSocket, by Simone Bordet
Realizzare applicazioni Web con WebSocket, by Simone Bordet
Codemotion
 
Resilient and Adaptable Systems with Cloud Native APIs
Resilient and Adaptable Systems with Cloud Native APIsResilient and Adaptable Systems with Cloud Native APIs
Resilient and Adaptable Systems with Cloud Native APIs
VMware Tanzu
 

Similar to WebSockets: The Current State of the Most Valuable HTML5 API for Java Developers (20)

Web-Socket
Web-SocketWeb-Socket
Web-Socket
 
Websocket
WebsocketWebsocket
Websocket
 
Enhancing Mobile User Experience with WebSocket
Enhancing Mobile User Experience with WebSocketEnhancing Mobile User Experience with WebSocket
Enhancing Mobile User Experience with WebSocket
 
Real-Time with Flowdock
Real-Time with FlowdockReal-Time with Flowdock
Real-Time with Flowdock
 
Signal r
Signal rSignal r
Signal r
 
Web sockets - Pentesting
Web sockets - Pentesting Web sockets - Pentesting
Web sockets - Pentesting
 
Jwebsocketmobiletechcon2010en 100912071225 Phpapp01
Jwebsocketmobiletechcon2010en 100912071225 Phpapp01Jwebsocketmobiletechcon2010en 100912071225 Phpapp01
Jwebsocketmobiletechcon2010en 100912071225 Phpapp01
 
jWebSocket MobileTechCon 2010 - WebSockets on Android, Symbian and BlackBerry
jWebSocket MobileTechCon 2010 - WebSockets on Android, Symbian and BlackBerryjWebSocket MobileTechCon 2010 - WebSockets on Android, Symbian and BlackBerry
jWebSocket MobileTechCon 2010 - WebSockets on Android, Symbian and BlackBerry
 
KSDG-iSlide App 開發心得分享
KSDG-iSlide App 開發心得分享KSDG-iSlide App 開發心得分享
KSDG-iSlide App 開發心得分享
 
Ecom 1
Ecom 1Ecom 1
Ecom 1
 
Socket.io
Socket.ioSocket.io
Socket.io
 
Real time web apps
Real time web appsReal time web apps
Real time web apps
 
WebSocket Perspectives and Vision for the Future
WebSocket Perspectives and Vision for the FutureWebSocket Perspectives and Vision for the Future
WebSocket Perspectives and Vision for the Future
 
Connected Web Systems
Connected Web SystemsConnected Web Systems
Connected Web Systems
 
Data power v7 update - Ravi Katikala
Data power v7 update - Ravi KatikalaData power v7 update - Ravi Katikala
Data power v7 update - Ravi Katikala
 
Real time Communication with Signalr (Android Client)
Real time Communication with Signalr (Android Client)Real time Communication with Signalr (Android Client)
Real time Communication with Signalr (Android Client)
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSockets
 
DevCon5 (July 2014) - Acision SDK
DevCon5 (July 2014) - Acision SDKDevCon5 (July 2014) - Acision SDK
DevCon5 (July 2014) - Acision SDK
 
Realizzare applicazioni Web con WebSocket, by Simone Bordet
Realizzare applicazioni Web con WebSocket, by Simone BordetRealizzare applicazioni Web con WebSocket, by Simone Bordet
Realizzare applicazioni Web con WebSocket, by Simone Bordet
 
Resilient and Adaptable Systems with Cloud Native APIs
Resilient and Adaptable Systems with Cloud Native APIsResilient and Adaptable Systems with Cloud Native APIs
Resilient and Adaptable Systems with Cloud Native APIs
 

More from Viktor Gamov

[DataSciCon] Divide, distribute and conquer stream v. batch
[DataSciCon] Divide, distribute and conquer  stream v. batch[DataSciCon] Divide, distribute and conquer  stream v. batch
[DataSciCon] Divide, distribute and conquer stream v. batch
Viktor Gamov
 
[Philly JUG] Divide, Distribute and Conquer: Stream v. Batch
[Philly JUG] Divide, Distribute and Conquer: Stream v. Batch[Philly JUG] Divide, Distribute and Conquer: Stream v. Batch
[Philly JUG] Divide, Distribute and Conquer: Stream v. Batch
Viktor Gamov
 
Testing containers with TestContainers @ AJUG 7/18/2017
Testing containers with TestContainers @ AJUG 7/18/2017Testing containers with TestContainers @ AJUG 7/18/2017
Testing containers with TestContainers @ AJUG 7/18/2017
Viktor Gamov
 
Distributed caching for your next node.js project cf summit - 06-15-2017
Distributed caching for your next node.js project   cf summit - 06-15-2017Distributed caching for your next node.js project   cf summit - 06-15-2017
Distributed caching for your next node.js project cf summit - 06-15-2017
Viktor Gamov
 
[Philly ETE] Java Puzzlers NG
[Philly ETE] Java Puzzlers NG[Philly ETE] Java Puzzlers NG
[Philly ETE] Java Puzzlers NG
Viktor Gamov
 
Распределяй и властвуй — 2: Потоки данных наносят ответный удар
Распределяй и властвуй — 2: Потоки данных наносят ответный ударРаспределяй и властвуй — 2: Потоки данных наносят ответный удар
Распределяй и властвуй — 2: Потоки данных наносят ответный удар
Viktor Gamov
 
[JBreak] Блеск И Нищета Распределенных Стримов - 04-04-2017
[JBreak] Блеск И Нищета Распределенных Стримов - 04-04-2017[JBreak] Блеск И Нищета Распределенных Стримов - 04-04-2017
[JBreak] Блеск И Нищета Распределенных Стримов - 04-04-2017
Viktor Gamov
 

More from Viktor Gamov (7)

[DataSciCon] Divide, distribute and conquer stream v. batch
[DataSciCon] Divide, distribute and conquer  stream v. batch[DataSciCon] Divide, distribute and conquer  stream v. batch
[DataSciCon] Divide, distribute and conquer stream v. batch
 
[Philly JUG] Divide, Distribute and Conquer: Stream v. Batch
[Philly JUG] Divide, Distribute and Conquer: Stream v. Batch[Philly JUG] Divide, Distribute and Conquer: Stream v. Batch
[Philly JUG] Divide, Distribute and Conquer: Stream v. Batch
 
Testing containers with TestContainers @ AJUG 7/18/2017
Testing containers with TestContainers @ AJUG 7/18/2017Testing containers with TestContainers @ AJUG 7/18/2017
Testing containers with TestContainers @ AJUG 7/18/2017
 
Distributed caching for your next node.js project cf summit - 06-15-2017
Distributed caching for your next node.js project   cf summit - 06-15-2017Distributed caching for your next node.js project   cf summit - 06-15-2017
Distributed caching for your next node.js project cf summit - 06-15-2017
 
[Philly ETE] Java Puzzlers NG
[Philly ETE] Java Puzzlers NG[Philly ETE] Java Puzzlers NG
[Philly ETE] Java Puzzlers NG
 
Распределяй и властвуй — 2: Потоки данных наносят ответный удар
Распределяй и властвуй — 2: Потоки данных наносят ответный ударРаспределяй и властвуй — 2: Потоки данных наносят ответный удар
Распределяй и властвуй — 2: Потоки данных наносят ответный удар
 
[JBreak] Блеск И Нищета Распределенных Стримов - 04-04-2017
[JBreak] Блеск И Нищета Распределенных Стримов - 04-04-2017[JBreak] Блеск И Нищета Распределенных Стримов - 04-04-2017
[JBreak] Блеск И Нищета Распределенных Стримов - 04-04-2017
 

Recently uploaded

Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 

Recently uploaded (20)

Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 

WebSockets: The Current State of the Most Valuable HTML5 API for Java Developers

  • 1. WEB SOCKETS CURRENT STATE FOR JAVA DEVELOPERS
  • 2. Web SOCKETS CURRENT STATE FOR JAVA DEVELOPERS PRESENTED BY VIKTOR GAMOV
  • 3. WEB SOCKETS AGENDA BIT OF MEET WEBSOCKETS Q&A HISTORY THE WEBSOCKETS IN ACTION SESSION ?
  • 4. OPTIONS FOR “REALTIME” WEB “LEGACY” WEB POLLING LONG-POLLING STEAMING Browser sends HTTP requests at Browser sends a request to the regular intervals and server and the server keeps the Browser sends a complete immediately receives a request open for a set period request, but the server sends response. However, real- time of time. If a notification is and maintains an open data is often not that received within that period, a response that is continuously predictable, making response containing the updated and kept open unnecessary requests message is sent to the client. If indefinitely (or for a set period inevitable and as a result, a notification is not received of time) many connections are opened within the set time period, the and closed needlessly in low- server sends a response to message-rate situations terminate the open request.
  • 5. WHAT IS WEBSOCKET “Reducing kilobytes of data to 2 bytes... and reducing latency from 150ms to 50 ms is far more than marginal. In fact, these two factors alone are enough to make WebSocket seriously interesting...” www.ietf.org/mail-archive/web/hybi/current/msg00784.html
  • 6. WHAT IS WEBSOCKETS? WEB SOCKET STANDARD PROTOCOL CLIENT-SIDE API SERVER-SIDE API Websocket is a HTML5 specification True real-time server standardized technology introduces WebSocket updates. Expected large (described in RFC6455) client side object. No penetration in Java to support low-overhead plugin required. world with upcoming bidirectional traffic from JavaEE 7 spec and your Web browser. JSR-356
  • 7. WEBSOCKET HANDSHAKE To Start full-duplex communication client should send UPGRADE request 1 2 3 4 SEND RECEIVE CHANGE LISTEN UPGRADE UPGRADE READYSTATE MESSAGE REQUEST RESPONSE TO OPEN EVENT
  • 9.
  • 10. WEBSOCKET INTERFACE [Constructor(DOMString  url,  optional  (DOMString  or  DOMString[])  protocols)] interface  WebSocket  :  EventTarget  {    readonly  attribute  DOMString  url;    //  ready  state    const  unsigned  short  CONNECTING  =  0;    const  unsigned  short  OPEN  =  1;    const  unsigned  short  CLOSING  =  2;    const  unsigned  short  CLOSED  =  3;    readonly  attribute  unsigned  short  readyState;    readonly  attribute  unsigned  long  bufferedAmount;    //  networking    [TreatNonCallableAsNull]  attribute  Function?  onopen;    [TreatNonCallableAsNull]  attribute  Function?  onerror;    [TreatNonCallableAsNull]  attribute  Function?  onclose;    readonly  attribute  DOMString  extensions;    readonly  attribute  DOMString  protocol;    void  close([Clamp]  optional  unsigned  short  code,  optional  DOMString  reason);    //  messaging    [TreatNonCallableAsNull]  attribute  Function?  onmessage;                      attribute  DOMString  binaryType;    void  send(DOMString  data);    void  send(ArrayBufferView  data);    void  send(Blob  data); };
  • 11. CLIENT-SIDE WEBSOCKET API var  ws; if  (window.WebSocket)  {        output("WebSocket  supported  in  your  browser");        ws  =  new  WebSocket("ws://www.websockets.org");        //  Set  event  handlers.        ws.onopen  =  function  ()  {                output("onopen");        };        ws.onmessage  =  function  (e)  {                //  e.data  contains  received  string.                output("echo  from  server  :  "  +  e.data);        };        ws.onclose  =  function  ()  {                output("onclose");        };        ws.onerror  =  function  ()  {                output("onerror");        }; } else  {output("WebSocket  not  supported  in  your  browser");}
  • 12. JAVA EE 7 SERVER-SIDE API package  org.javaee.glassfishwebsocket; import  org.glassfish.websocket.api.annotations.WebSocket; import  org.glassfish.websocket.api.annotations.WebSocketMessage; @WebSocket(path  =  "/echo") public  class  EchoBean  {        @WebSocketMessage        public  String  echo(String  message)  {                System.out.println("#####################  Message  received");                return  message  +  "  (from  your  server)";        } }
  • 13. TOMCAT 7.0.29 SERVER-SIDE API SHOW THE CODE Not enough room for code in this slide ;-)
  • 14. PROGRAMMING WEBSOCKETS Client-side frameworks ✦jquery.socket.js ✦https://github.com/flowersinthesand/jquery-socket/wiki ✦atmosphere.js ✦https://github.com/Atmosphere/atmosphere/wiki/jQuery.atmosphere.js-API ✦socket.io
  • 15. WEBSOCKET SUPPORT JAVA-based Web servers with native support. The WebServer has API for WebSocket ✦Netty 3.3.x ✦Jetty 7.x, 8.x ✦Glassfish 3.1.2 ✦Tomcat 7.0.27
  • 16. WHAT SHOULD WE DO? WE CAN DO IT!
  • 17. WHAT IS ATMOSPHERE Atmosphere https://github.com/Atmosphere/atmosphere/ ✦portable framework for ✦long-polling ✦Streaming ✦Server-Send Events ✦WebSockets ✦can auto select best transport ✦abstracting from actual underlying container mechanism
  • 19. USE CASE OUR CLIENTS WebSockets really shine with following applications: ✦Live trading/sports ticker ✦Controlling medical equipment over the web ✦Chat applications ✦Multiplayer online games ✦Realtime updating social streams
  • 20. BUNCH OF USEFUL LINKS ✦http://www.w3.org/TR/websockets/ MUST! ✦http://tools.ietf.org/html/rfc6455 MUST! ✦http://tomcat.apache.org/tomcat-7.0-doc/web-socket-howto.html ✦http://websocket-sdk.java.net/Introduction.html ✦https://github.com/Atmosphere/atmosphere/wiki/Supported- WebServers-and-Browsers ✦http://autobahn.ws/testsuite
  • 21. Q AND A Q&A Put your questions
  • 22. CONTACT US WWW.FARATASYSTEMS.COM INFO@FARATASYSTEMS.COM
  • 23. FIND ME TWITTER GITHUB WWW.TWITTER.COM/GAMUSSA WWW.GITHUB.COM/GAMUSSA
  • 24. THANK YOU THANK YOU FOR YOUR ATTENTION HTTP://WWW.FARATASYSTEMS.COM