O'Reilly logo

Java® Programming 24-Hour Trainer by Yakov Fain

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 18

Network Programming

Computers connected to a network can communicate with each other only if they agree on the rules of communication, called protocols, that define how to request the data, if the data should be sent in pieces, how to acknowledge received data, if the connection between two computers should remain open, and so on. TCP/IP, UDP/IP, FTP, and HTTP are some examples of network protocols.

Local area network (LAN) refers to a computer network connecting devices in a small area — the same office or house, or a rack. Interconnected computers located farther apart or that belong to different companies are part of a wide area network (WAN). The Internet consists of millions of networks and individual devices. When connected networks belong to the same organization it is referred to as an intranet. For security reasons intranets are shielded from the rest of the world by special software called firewalls.

The World Wide Web (WWW) uses uniform resource locators (URLs) to identify online resources. For example, the following URL says that there is (or will be generated on the fly) a file called training.html located at the remote host known as mycompany.com, and that the program should use the HTTP protocol to request this file. It also states that this request has to be sent via port 80.

www.mycompany.com:80/training.html

The hostname must be unique and it is automatically converted to the IP address of the physical server by your Internet service provider (ISP) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required