Chapter 11: Network Programming
In this chapter, we will describe and discuss the most popular network protocols – User Datagram Protocol (UDP), Transmission Control Protocol (TCP), HyperText Transfer Protocol (HTTP), and WebSocket – and their support from the Java Class Library (JCL). We will demonstrate how to use these protocols and how to implement client-server communication in Java code. We will also review Uniform Resource Locator (URL)-based communication and the latest Java HTTP Client API. After studying this chapter, you will be able to create server and client applications that communicate using the UDP, TCP, and HTTP protocols as well as WebSocket.
The following topics will be covered in this chapter:
- Network protocols
- UDP-based communication
- TCP-based communication
- UDP versus TCP protocols
- URL-based communication
- Using the HTTP 2 Client API
- Creating a standalone application HTTP server
By the end of the chapter,...