Java socket support for HTTP client/server applications

An HTTP client will make a connection to an HTTP server. The client will send a request message to the server. The server will send back a response message, frequently, as an HTML document. In the early HTTP version, once the response was sent, the server would terminate the connection. This is sometimes referred to as a stateless protocol because the connection is not maintained.

With HTTP/1.1, persistent connections can be maintained. This improves the performance by eliminating the need to open and close connections when multiple pieces of data need to be transferred between the server and a client.

We will focus on creating an HTTP server and an HTTP client. While browsers typically serve ...

Get Learning Network Programming with Java now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.