A Client Socket in Java

This section shows a simple example of using a socket to communicate with another computer. You should type this code in and try it. If you haven't done much network programming, you'll find it a gleeful experience as you network with systems around the planet, and even in space. The space shuttle has a TCP/IP network connection to Mission Control, but the spoilsports at NASA keep its address secret, so we'll use a different host.

There is an Internet protocol known as Network Time Protocol or NTP. NTP is used to synchronize the clocks of some computers. Without periodic sync'ing, computer clocks tend to drift out of alignment, causing problems for times they need to agree on, like email and file timestamps. NTP is ...

Get Just Java™ 2 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.