Synopses & Reviews
J a v a N e t w o r k P r o g r a m m i n g i s a c o m p l e t e i n t r o d u c t i o n t o d e v e l o p i n g n e t w o r k p r o g r a m s ( b o t h a p p l e t s a n d a p p l i c a t i o n s ) u s i n g J a v a . I t c o v e r s e v e r y t h i n g f r o m n e t w o r k i n g f u n d a m e n t a l s t o r e m o t e m e t h o d i n v o c a t i o n ( R M I ) . I t i n c l u d e s c h a p t e r s o n T C P a n d U D P s o c k e t s, m u l t i c a s t i n g p r o t o c o l a n d c o n t e n t h a n d l e r s, a n d s e r v l e t s . T h i s s e c o n d e d i t i o n a l s o i n c l u d e s c o v e r a g e o f J a v a 1 . 1, 1 . 2 a n d 1 . 3 . N e w c h a p t e r s c o v e r m u l t i t h r e a d e d n e t w o r k p r o g r a m m i n g, I / O, H T M L p a r s i n g a n d d i s p l a y, t h e J a v a M a i l A P I, t h e J a v a S e c u r e S o c k e t s E x t e n s i o n, a n d m o r e .
Java Network Programming, 2nd Edition, is a complete introduction to developing network programs (both applets and applications) using Java, covering everything from Networking fundamentals to remote method invocation (RMI). It includes chapters on TCP and UDP sockets, multicasting protocol and content handlers, and servlets. This second edition also includes coverage of Java 1.1, 1.2 and 1.3. New chapters cover multithreaded network programming, I/O, HTML parsing and display, the Java Mail API, the Java Secure Sockets Extension, and more.
This is an introduction to developing network programs (both applets and applications) using Java, covering everything from Networking fundamentals to remote method invocation (RMI). It includes chapters on TCP and UDP sockets, multicasting protocol and content handlers, and servlets.
This revised edition has been completely rewritten to cover Java 1.1, 1.2, and 1.3. New chapters covers multithreaded network programming, I/O, HTML parsing and display, the Java Mail API, the Java Secure Sockets Extension, and more.
About the Author
Elliotte Rusty Harold is originally from New Orleans to which he returns periodically in search of a decent bowl of gumbo. However, he currently resides in the Prospect Heights neighborhood of Brooklyn with his wife Beth and dog Thor. He's a frequent speaker at industry conferences including Software Development, Dr. Dobb's Architecture & Design World, SD Best Practices, Extreme Markup Languages, and too many user groups to count. His open source projects include the XOM Library for processing XML with Java and the Amateur media player.
Table of Contents
Preface; About the Second Edition; Organization of the Book; Who You Are; Java Versions; Security; About the Examples; Conventions Used in This Book; Request for Comments; Acknowledgments; Chapter 1: Why Networked Java?; 1.1 What Can a Network Program Do?; 1.2 But Wait!--There's More!; Chapter 2: Basic Network Concepts; 2.1 Networks; 2.2 The Layers of a Network; 2.3 IP, TCP, and UDP; 2.4 The Internet; 2.5 The Client/Server Model; 2.6 Internet Standards; Chapter 3: Basic Web Concepts; 3.1 URIs; 3.2 HTML, SGML, and XML; 3.3 HTTP; 3.4 MIME; 3.5 CGI; 3.6 Applets and Security; Chapter 4: Java I/O; 4.1 Output Streams; 4.2 Input Streams; 4.3 Filter Streams; 4.4 Readers and Writers; Chapter 5: Threads; 5.1 Running Threads; 5.2 Returning Information from a Thread; 5.3 Synchronization; 5.4 Deadlock; 5.5 Thread Scheduling; 5.6 Thread Pools; Chapter 6: Looking Up Internet Addresses; 6.1 DNS, IP Addresses, and All That; 6.2 The InetAddress Class; 6.3 Some Useful Programs; Chapter 7: Retrieving Data with URLs; 7.1 The URL Class; 7.2 The URLEncoder and URLDecoder Classes; 7.3 Communicating with CGIs and Servlets Through GET; 7.4 Accessing Password-Protected Sites; Chapter 8: HTML in Swing; 8.1 HTML on Components; 8.2 JEditorPane; 8.3 Parsing HTML; Chapter 9: The Network Methods of java.applet.Applet; 9.1 Using java.applet.Applet to Download Data; 9.2 The ImageObserver Interface; 9.3 The MediaTracker Class; 9.4 Network Methods of java.applet.AppletContext; Chapter 10: Sockets for Clients; 10.1 Socket Basics; 10.2 Investigating Protocols with Telnet; 10.3 The Socket Class; 10.4 Socket Exceptions; 10.5 Examples; Chapter 11: Sockets for Servers; 11.1 The ServerSocket Class; 11.2 Some Useful Servers; Chapter 12: Secure Sockets; 12.1 Secure Communications; 12.2 Creating Secure Client Sockets; 12.3 Methods of the SSLSocket Class; 12.4 Creating Secure Server Sockets; 12.5 Methods of the SSLServerSocket Class; Chapter 13: UDP Datagrams and Sockets; 13.1 The UDP Protocol; 13.2 The DatagramPacket Class; 13.3 The DatagramSocket Class; 13.4 Some Useful Applications; Chapter 14: Multicast Sockets; 14.1 What Is a Multicast Socket?; 14.2 Working with Multicast Sockets; 14.3 Two Simple Examples; Chapter 15: The URLConnection Class; 15.1 Opening URLConnections; 15.2 Reading Data from a Server; 15.3 Reading the Header; 15.4 Configuring the Connection; 15.5 Configuring the Client Request MIME Header; 15.6 Writing Data to a Server; 15.7 Content Handlers; 15.8 The Object Methods; 15.9 Security Considerations for URLConnections; 15.10 Guessing MIME Types; 15.11 HttpURLConnection; 15.12 JarURLConnection; Chapter 16: Protocol Handlers; 16.1 What Is a Protocol Handler?; 16.2 The URLStreamHandler Class; 16.3 Writing a Protocol Handler; 16.4 More Protocol Handler Examples and Techniques; 16.5 The URLStreamHandlerFactory Interface; Chapter 17: Content Handlers; 17.1 What Is a Content Handler?; 17.2 The ContentHandler Class; 17.3 The ContentHandlerFactory Interface; 17.4 A Content Handler for an Image Format: image/x-fits; Chapter 18: Remote Method Invocation; 18.1 What Is Remote Method Invocation?; 18.2 Implementation; 18.3 Loading Classes at Runtime; 18.4 The java.rmi Package; 18.5 The java.rmi.registry Package; 18.6 The java.rmi.server Package; Chapter 19: The JavaMail API; 19.1 What Is the JavaMail API?; 19.2 Sending Email; 19.3 Receiving Mail; 19.4 Password Authentication; 19.5 Addresses; 19.6 The URLName Class; 19.7 The Message Class; 19.8 The Part Interface; 19.9 Multipart Messages and File Attachments; 19.10 MIME Messages; 19.11 Folders; Colophon;