Book description
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.
Table of contents
-
Java Network Programming, 2nd Edition
- Preface
- 1. Why Networked Java?
- 2. Basic Network Concepts
- 3. Basic Web Concepts
- 4. Java I/O
- 5. Threads
-
6. Looking Up Internet Addresses
- DNS, IP Addresses, and All That
-
The InetAddress Class
-
Creating New InetAddress Objects
- public static InetAddress InetAddress.getByName(String hostName) throws UnknownHostException
- public static InetAddress[ ] InetAddress.getAllByName (String hostName) throws UnknownHostException
- public static InetAddress InetAddress.getLocalHost( ) throws UnknownHostException
- Security issues
- Other sources of InetAddress objects
- Getter Methods
- Object Methods
-
Creating New InetAddress Objects
- Some Useful Programs
- 7. Retrieving Data with URLs
- 8. HTML in Swing
-
9. The Network Methods of java.applet.Applet
- Using java.applet.Applet to Download Data
- The ImageObserver Interface
- The MediaTracker Class
- Network Methods of java.applet.AppletContext
-
10. Sockets for Clients
- Socket Basics
- Investigating Protocols with Telnet
-
The Socket Class
-
The Constructors
- public Socket(String host, int port) throws UnknownHostException, IOException
- public Socket(InetAddress host, int port) throws IOException
- public Socket(String host, int port, InetAddress interface, int localPort) throws IOException
- public Socket(InetAddress host, int port, InetAddress interface, int localPort) throws IOException
- protected Socket( )
- protected Socket(SocketImpl impl)
- Getting Information About a Socket
- Closing the Socket
- The Object Methods
- Setting Socket Options
-
The Constructors
- Socket Exceptions
- Examples
- 11. Sockets for Servers
- 12. Secure Sockets
- 13. UDP Datagrams and Sockets
-
14. Multicast Sockets
- What Is a Multicast Socket?
-
Working with Multicast Sockets
- The Constructors
-
Communicating with a Multicast Group
- public void joinGroup(InetAddress address) throws IOException
- public void leaveGroup(InetAddress address) throws IOException
- public void send(DatagramPacket packet, byte ttl) throws IOException
- public void setInterface(InetAddress address) throws SocketException
- public InetAddress getInterface( ) throws SocketException
- public void setTimeToLive(int ttl) throws IOException // Java 1.2
- public int getTimeToLive( ) throws IOException // Java 1.2
- Two Simple Examples
-
15. The URLConnection Class
- Opening URLConnections
- Reading Data from a Server
- Reading the Header
- Configuring the Connection
- Configuring the Client Request MIME Header
- Writing Data to a Server
- Content Handlers
- The Object Methods
- Security Considerations for URLConnections
- Guessing MIME Types
- HttpURLConnection
- JarURLConnection
-
16. Protocol Handlers
- What Is a Protocol Handler?
-
The URLStreamHandler Class
- The Constructor
-
Methods for Parsing URLs
- Protected void parseURL(URL u, String spec, int start, int limit)
- Protected String toExternalForm(URL u)
- Protected void setURL(URL u, String protocol, String host, int port, String file, String ref )
- Protected int getDefaultPort( ) // Java 1.3
- Protected InetAddress getHostAddress(URL u) // Java 1.3
- Protected boolean hostsEqual(URL u1, URL u2) // Java 1.3
- Protected boolean sameFile(URL u1, URL u2) // Java 1.3
- Protected boolean equals(URL u1, URL u2) // Java 1.3
- Protected int hashCode(URL u) // Java 1.3
- A Method for Connecting
- Writing a Protocol Handler
- More Protocol Handler Examples and Techniques
- The URLStreamHandlerFactory Interface
- 17. Content Handlers
-
18. Remote Method Invocation
- What Is Remote Method Invocation?
- Implementation
- Loading Classes at Runtime
-
The java.rmi Package
- The Remote Interface
-
The Naming Class
- public static String[ ] list(String url) throws RemoteException, MalformedURLException
- public static Remote lookup(String url) throws RemoteException, NotBoundException, AccessException, MalformedURLException
- public static void bind(String url, Remote object) throws RemoteException, AlreadyBoundException, MalformedURLException, AccessException
- public static void unbind(String url) throws RemoteException, NotBoundException, AlreadyBoundException, MalformedURLException, AccessException // Java 1.2
- public static void rebind(String url, Remote object) throws RemoteException, AccessException, MalformedURLException
- The RMISecurityManager Class
- Remote Exceptions
- The java.rmi.registry Package
- The java.rmi.server Package
- 19. The JavaMail API
- Index
- Colophon
Product information
- Title: Java Network Programming, Second Edition
- Author(s):
- Release date: August 2000
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781565928701
You might also like
book
Java Network Programming, 4th Edition
This practical guide provides a complete introduction to developing network programs with Java. You’ll learn how …
book
Learning Network Programming with Java
Harness the hidden power of Java to build network-enabled applications with lower network traffic and faster …
video
Java Concurrency, 2/e
9+ Hours of Video Instruction Java Concurrency LiveLessons, Second Edition teaches you how to develop high-quality …
book
Java Projects - Second Edition
Learn how to build scalable, resilient, and effective applications in Java that suit your software requirements. …