Chapter 3. Networking

We begin this chapter by reviewing basic networking concepts, then move on to writing Java programs that connect to network services. We will show you how network clients and servers are implemented. Finally, you will see how to send e-mail from a Java program and how to harvest information from a web server.

3.1. Connecting to a Server

Before writing our first network program, let’s discuss a great debugging tool for network programming that you already have—namely, telnet. Telnet is pre-installed on most systems. You should be able to launch it by typing telnet from a command shell.

Note

In Windows ...

Get Core Java, Volume II--Advanced Features, 9th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.