Table of Contents |
The Java environment is highly regarded in part because of its suitability to writing programs that use and interact with the resources on the Internet and the World-Wide Web. In fact, Java-capable browsers use this capability of the Java environment to the extreme to transport and run applets over the net.The Custom Networking and Security trail walks you through the complexities of writing Internet-aware Java applications and applets.
What You May Already Know About Networking in Java This lesson describes the networking capabilities of the Java environment that you may already be using without realizing it!
Working with URLs A Uniform Resource Locator (URL) is an address of a resource on the Internet. Your Java programs can use URLs to connect to and retrieve information over the network. This lesson provides a more complete definition of URL, shows you how to create and parse URLs, how to open a connection to a URL, and how to read from and write to those connections. In addition, this lesson has a section for advanced networking programmers who want to create their own URL content and stream handlers, and a section describing two helper classes--InetAddress and URLEncoder.
All about Sockets A socket is one end of a two-way communications link between two programs running on the network. This lesson first shows you how to read from and write to a socket from a client program communciating with a standard server program--the echo server. Also, this lesson walks you through the details of a complete client/server example showing you how to implement both the client and the server side of a client/server pair.
All about Datagrams The previous lessons focused on "perfect" communication links between applications running on the network. Perfect communication links guarantee the arrival of all packets in the order they were sent. While necessary for some applications, perfect links are overkill for others. These applications use datagrams instead. The delivery of datagrams is not guaranteed nor is the order in which they are delivered. This lesson takes you step-by-step through a client/server example that use datagrams to communicate.
Providing Your Own Security Manager One concern about running programs over the network becomes security. Java let's you implement your own security protocols using a custom security manager.
Table of Contents |