O'Reilly logo

Platinum Edition Using XHTML™, XML, and Java™ 2 by Andrew H. Watt, Mike Morgan, Jim O'Donnell, Eric Ladd

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

Writing Your Own Client and Server

Applets are restricted from connecting to just any Web server. They can only connect back to the server from which they were downloaded. If you want to give an applet access to the rest of the Internet, you'll need to place a server on the same machine that hosts the applet. You can use a commercial server such as a File Transfer Protocol (FTP) server, or you can write your own special-purpose server.

When you write a server, you write a program that opens a socket (typically on a well-known port number) and waits for some client to connect. The client calls in from some unused port number (called an ephemeral port). As soon as the client and the server connect, it's common for the server to propose that the ...

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