Java Magazine, Jan/Feb 2016
learn more ORACLE COM JAVAMAGAZINE JANUARY FEBRUARY 2016 58 web apps when someone leaves the chatroom without saying goodbye Looking back at the screenshots we can now see the diference between the manner in which Jess and Rob left the room Conclusion In this two part article we have learned how to create a Java WebSocket endpoint We have explored the basic concepts of the WebSocket protocol and what kinds of situations demand their true server push nature We have looked at the lifecycle of a Java WebSocket endpoint examined the main classes of the Java WebSocket API and looked at encoding and decoding techniques including the variety of messaging modes supported in the Java WebSocket API We looked at how server endpoints are mapped to the URI space of a web application and how client requests are matched to endpoints therein We concluded with a look at a Chat application that exercises many of the features of the Java WebSocket API Armed with this knowledge now you can easily build applications with long lived connections article This article was adapted from the book Java EE 7 The Big Picture with kind permission from the publisher Oracle Press Danny Coward is the principal software engineer at Liquid Robotics Earlier he was a member of the Java development team at Oracle and previously at Sun Microsystems where he worked extensively on WebSockets among other responsibilities Oracles Java WebSockets tutorial Long polling a WebSocket alternative
You must have JavaScript enabled to view digital editions.