From the course: WebSocket Programming with Java EE
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
WebSocket client API
From the course: WebSocket Programming with Java EE
WebSocket client API
- [Instructor] The WebSocket Protocol offers full, duplex communication and for this to be possible there must be a Client and a server. The server endpoint is developed in Java and hazard on the server. And often the client is a webpage, usually implemented in JavaScript and HTML5. However, this does not have to be the case. We can develop a client in Java and by doing so we can let two machines communicate with each other. Let's take a look at the client API that the Java API for WebSocket provides and see how to use it to develop a very lightweight chat application. The Client requires a minimum of two parts. The Client endpoint that handles the messages and the Client manager that makes a connection to the server endpoint. The Client endpoint is defined by annotating a class Client endpoint and passing it configurations for message encoding and decoding. The other part is ClientManager which connects and manages the Client lifecycle. For this we're going to use an instance of the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
WebSocket methodologies1m 52s
-
(Locked)
WebSocket functionality1m 56s
-
(Locked)
Annotation methodology2m 38s
-
Implement WebSocket lifecycles6m 37s
-
(Locked)
Configure the session5m 32s
-
(Locked)
Lifecycle logic4m 1s
-
(Locked)
Programmatic methodology1m 16s
-
(Locked)
WebSocket client API1m 37s
-
(Locked)
Code a client API6m 54s
-
(Locked)
✓ Challenge: Code programmatic endpoint31s
-
(Locked)
✓ Solution: Code programmatic endpoint1m 9s
-
(Locked)
-
-
-
-
-