Chapter 11. Network Programming with Sockets and RMI
The network
is the soul of Java. Most of what is new and exciting about Java
centers around the potential for new kinds of dynamic, networked
applications. In this chapter, we’ll start our discussion of
the java.net
package, which contains the fundamental
classes for communications and working with networked resources.
We’ll also talk about the java.rmi package,
which provides Java’s powerful, high-level, Remote Method
Invocation facilities.
The classes of java.net fall into two categories:
the sockets API and tools for working with Uniform Resource Locators
(URLs). Figure 11.1 shows the
java.net package.

Figure 11-1. The java.net package
Java’s sockets API provides access to the standard network protocols used for communications between hosts on the Internet. Sockets are the mechanism underlying all other kinds of portable networked communications. Sockets are a low-level tool—you can use sockets for any kind of communications between client and server server or peer applications on the Net, but you have to implement your own application-level protocols for handling and interpreting the data. Higher-level networking tools, like remote method invocation and other distributed object systems, are implemented on top of sockets.
Java remote method invocation (RMI) is a powerful tool that leverages Java object serialization, allowing ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access