Table of Contents |
| Preface | xiii |
1. | Why Networked Java? | 1 |
| | What Can a Network Program Do? | 2 |
| | But Wait!--There's More! | 19 |
2. | Basic Network Concepts | 20 |
| | Networks | 20 |
| | The Layers of a Network | 22 |
| | IP, TCP, and UDP | 28 |
| | The Internet | 32 |
| | The Client/Server Model | 37 |
| | Internet Standards | 39 |
3. | Basic Web Concepts | 49 |
| | URIs | 50 |
| | HTML, SGML, and XML | 56 |
| | HTTP | 58 |
| | MIME | 63 |
| | CGI | 68 |
| | Applets and Security | 71 |
4. | Java I/O | 75 |
| | Output Streams | 76 |
| | Input Streams | 80 |
| | Filter Streams | 84 |
| | Readers and Writers | 101 |
5. | Threads | 117 |
| | Running Threads | 119 |
| | Returning Information from a Thread | 124 |
| | Synchronization | 136 |
| | Deadlock | 144 |
| | Thread Scheduling | 145 |
| | Thread Pools | 159 |
6. | Looking Up Internet Addresses | 165 |
| | DNS, IP Addresses, and All That | 165 |
| | The InetAddress Class | 167 |
| | Some Useful Programs | 181 |
7. | Retrieving Data with URLs | 193 |
| | The URL Class | 193 |
| | The URLEncoder and URLDecoder Classes | 218 |
| | Communicating with CGIs and Servlets Through GET | 223 |
| | Accessing Password-Protected Sites | 228 |
8. | HTML in Swing | 236 |
| | HTML on Components | 236 |
| | JEditorPane | 238 |
| | Parsing HTML | 247 |
9. | The Network Methods of java.applet.Applet | 267 |
| | Using java.applet.Applet to Download Data | 267 |
| | The ImageObserver Interface | 276 |
| | The MediaTracker Class | 281 |
| | Network Methods of Java.applet.AppletContext | 297 |
10. | Sockets for Clients | 301 |
| | Socket Basics | 302 |
| | Investigating Protocols with Telnet | 302 |
| | The Socket Class | 304 |
| | Socket Exceptions | 329 |
| | Examples | 330 |
11. | Sockets for Servers | 350 |
| | The ServerSocket Class | 351 |
| | Some Useful Servers | 364 |
12. | Secure Sockets | 388 |
| | Secure Communications | 389 |
| | Creating Secure Client Sockets | 393 |
| | Methods of the SSLSocket Class | 397 |
| | Creating Secure Server Sockets | 403 |
| | Methods of the SSLServerSocket Class | 408 |
13. | UDP Datagrams and Sockets | 411 |
| | The UDP Protocol | 411 |
| | The DatagramPacket Class | 413 |
| | The DatagramSocket Class | 423 |
| | Some Useful Applications | 435 |
14. | Multicast Sockets | 450 |
| | What Is a Multicast Socket? | 451 |
| | Working with Multicast Sockets | 461 |
| | Two Simple Examples | 466 |
15. | The URLConnection Class | 472 |
| | Opening URLConnections | 473 |
| | Reading Data from a Server | 475 |
| | Reading the Header | 476 |
| | Configuring the Connection | 485 |
| | Configuring the Client Request MIME Header | 495 |
| | Writing Data to a Server | 497 |
| | Content Handlers | 503 |
| | The Object Methods | 505 |
| | Security Considerations for URLConnections | 505 |
| | Guessing MIME Types | 506 |
| | HttpURLConnection | 509 |
| | JarURLConnection | 525 |
16. | Protocol Handlers | 529 |
| | What Is a Protocol Handler? | 530 |
| | The URLStreamHandler Class | 534 |
| | Writing a Protocol Handler | 542 |
| | More Protocol Handler Examples and Techniques | 546 |
| | The URLStreamHandlerFactory Interface | 556 |
17. | Content Handlers | 560 |
| | What Is a Content Handler? | 562 |
| | The ContentHandler Class | 565 |
| | The ContentHandlerFactory Interface | 578 |
| | A Content Handler for an Image Format: image/x-fits | 581 |
18. | Remote Method Invocation | 594 |
| | What Is Remote Method Invocation? | 594 |
| | Implementation | 600 |
| | Loading Classes at Runtime | 609 |
| | The java.rmi Package | 617 |
| | The java.rmi.registry Package | 626 |
| | The java.rmi.server Package | 628 |
19. | The JavaMail API | 634 |
| | What Is the JavaMail API? | 635 |
| | Sending Email | 637 |
| | Receiving Mail | 648 |
| | Password Authentication | 654 |
| | Addresses | 658 |
| | The URLName Class | 663 |
| | The Message Class | 666 |
| | The Part Interface | 678 |
| | Multipart Messages and File Attachments | 690 |
| | MIME Messages | 695 |
| | Folders | 697 |
| Index | 711 |