WebSockets is one of the major overall advancements in HTTP communication. It extends HTTP to allow it to handle one or more full-duplex communication channels over a single HTTP connection, enabling all kinds of applications with real-time communication requirements to appear on the web market, such as chatting, multi-player gaming, collaborative document editing, and many more.
In Chapter 8, Sending Mails with JavaMail 1.6, we'll learn what WebSockets are and when to use them. Moreover, we'll learn and practice how to create WebSockets endpoints in Java and how to create a client for them in JavaScript. In addition, we'll learn how to maintain and encode user state in our server. At the end of the chapter, we'll look at a complete example of using WebSockets to implement a cinema tickets booking interface for our book's project.