Java Network Programming, 4th Edition
Read it now on the O’Reilly learning platform with a 10-day free trial.
O’Reilly members get unlimited access to books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.
Book description
This practical guide provides a complete introduction to developing network programs with Java. You’ll learn how to use Java’s network class library to quickly and easily accomplish common networking tasks such as writing multithreaded servers, encrypting communications, broadcasting to the local network, and posting data to server-side programs.
Author Elliotte Rusty Harold provides complete working programs to illustrate the methods and classes he describes. This thoroughly revised fourth edition covers REST, SPDY, asynchronous I/O, and many other recent technologies.
- Explore protocols that underlie the Internet, such as TCP/IP and UDP/IP
- Learn how Java’s core I/O API handles network input and output
- Discover how the InetAddress class helps Java programs interact with DNS
- Locate, identify, and download network resources with Java’s URI and URL classes
- Dive deep into the HTTP protocol, including REST, HTTP headers, and cookies
- Write servers and network clients, using Java’s low-level socket classes
- Manage many connections at the same time with the nonblocking I/O
Publisher resources
Table of contents
- Dedication
- Preface
- About the Fourth Edition
- Organization of the Book
- Who You Are
- Java Versions
- About the Examples
- Conventions Used in This Book
- Request for Comments
- Using Code Examples
- Safari® Books Online
- How to Contact Us
- Acknowledgments
- Networks
- The Layers of a Network
- The Host-to-Network Layer
- The Internet Layer
- The Transport Layer
- The Application Layer
- IP Addresses and Domain Names
- Ports
- Internet Address Blocks
- Network Address Translation
- Firewalls
- Proxy Servers
- IETF RFCs
- W3C Recommendations
- Output Streams
- Input Streams
- Marking and Resetting
- Chaining Filters Together
- Buffered Streams
- PrintStream
- Data Streams
- Writers
- OutputStreamWriter
- Readers
- Filter Readers and Writers
- PrintWriter
- Running Threads
- Subclassing Thread
- Implementing the Runnable Interface
- Race Conditions
- Polling
- Callbacks
- Futures, Callables, and Executors
- Synchronized Blocks
- Synchronized Methods
- Alternatives to Synchronization
- Priorities
- Preemption
- Blocking
- Yielding
- Sleeping
- Joining threads
- Waiting on an object
- Finish
- The InetAddress Class
- Creating New InetAddress Objects
- Caching
- Lookups by IP address
- Security issues
- Factory Methods
- public static NetworkInterface getByName(String name) throws SocketException
- public static NetworkInterface getByInetAddress(InetAddress address) throws SocketException
- public static Enumeration getNetworkInterfaces() throws SocketException
- public Enumeration getInetAddresses()
- public String getName()
- public String getDisplayName()
- SpamCheck
- Processing Web Server Logfiles
- URIs
- URLs
- Relative URLs
- Creating New URLs
- Constructing a URL from a string
- Constructing a URL from its component parts
- Constructing relative URLs
- Other sources of URL objects
- public final InputStream openStream() throws IOException
- public URLConnection openConnection() throws IOException
- public final Object getContent() throws IOException
- public final Object getContent(Class[] classes) throws IOException
- public String getProtocol()
- public String getHost()
- public int getPort()
- public int getDefaultPort()
- public String getFile()
- public String getPath()
- public String getRef()
- public String getQuery()
- public String getUserInfo()
- public String getAuthority()
- Constructing a URI
- The Parts of the URI
- Resolving Relative URIs
- Equality and Comparison
- String Representations
- URLEncoder
- URLDecoder
- System Properties
- The Proxy Class
- The ProxySelector Class
- The Authenticator Class
- The PasswordAuthentication Class
- The JPasswordField Class
- The Protocol
- Keep-Alive
- CookieManager
- CookieStore
- Opening URLConnections
- Reading Data from a Server
- Reading the Header
- Retrieving Specific Header Fields
- public String getContentType()
- public int getContentLength()
- public String getContentEncoding()
- public long getDate()
- public long getExpiration()
- public long getLastModified()
- public String getHeaderField(String name)
- public String getHeaderFieldKey(int n)
- public String getHeaderField(int n)
- public long getHeaderFieldDate(String name, long default)
- public int getHeaderFieldInt(String name, int default)
- Web Cache for Java
- protected URL url
- protected boolean connected
- protected boolean allowUserInteraction
- protected boolean doInput
- protected boolean doOutput
- protected boolean ifModifiedSince
- protected boolean useCaches
- Timeouts
- The Request Method
- HEAD
- DELETE
- PUT
- OPTIONS
- TRACE
- Error conditions
- Redirects
- Using Sockets
- Investigating Protocols with Telnet
- Reading from Servers with Sockets
- Writing to Servers with Sockets
- Half-closed sockets
- Basic Constructors
- Picking a Local Interface to Connect From
- Constructing Without Connecting
- Socket Addresses
- Proxy Servers
- Closed or Connected?
- toString()
- TCP_NODELAY
- SO_LINGER
- SO_TIMEOUT
- SO_RCVBUF and SO_SNDBUF
- SO_KEEPALIVE
- OOBINLINE
- SO_REUSEADDR
- IP_TOS Class of Service
- Whois
- A Network Client Library
- Using ServerSockets
- Serving Binary Data
- Multithreaded Servers
- Writing to Servers with Sockets
- Closing Server Sockets
- What to Log
- How to Log
- Constructing Without Binding
- SO_TIMEOUT
- SO_REUSEADDR
- SO_RCVBUF
- Class of Service
- A Single-File Server
- A Redirector
- A Full-Fledged HTTP Server
- Secure Communications
- Creating Secure Client Sockets
- Choosing the Cipher Suites
- Event Handlers
- Session Management
- Client Mode
- Creating Secure Server Sockets
- Configuring SSLServerSockets
- Choosing the Cipher Suites
- Session Management
- Client Mode
- An Example Client
- An Example Server
- Buffers
- Creating Buffers
- Allocation
- Direct allocation
- Wrapping
- SocketChannel
- Connecting
- Reading
- Writing
- Closing
- Creating server socket channels
- Accepting connections
- The Selector Class
- The SelectionKey Class
- The UDP Protocol
- UDP Clients
- UDP Servers
- The DatagramPacket Class
- The Constructors
- Constructors for receiving datagrams
- Constructors for sending datagrams
- public InetAddress getAddress()
- public int getPort()
- public SocketAddress getSocketAddress()
- public byte[] getData()
- public int getLength()
- public int getOffset()
- public void setData(byte[] data)
- public void setData(byte[] data, int offset, int length)
- public void setAddress(InetAddress remote)
- public void setPort(int port)
- public void setAddress(SocketAddress remote)
- public void setLength(int length)
- The Constructors
- public DatagramSocket() throws SocketException
- public DatagramSocket(int port) throws SocketException
- public DatagramSocket(int port, InetAddress interface) throws SocketException
- public DatagramSocket(SocketAddress interface) throws SocketException
- protected DatagramSocket(DatagramSocketImpl impl) throws SocketException
- public void send(DatagramPacket dp) throws IOException
- public void receive(DatagramPacket dp) throws IOException
- public void close()
- public int getLocalPort()
- public InetAddress getLocalAddress()
- public SocketAddress getLocalSocketAddress()
- public void connect(InetAddress host, int port)
- public void disconnect()
- public int getPort()
- public InetAddress getInetAddress()
- public InetAddress getRemoteSocketAddress()
- SO_TIMEOUT
- SO_RCVBUF
- SO_SNDBUF
- SO_REUSEADDR
- SO_BROADCAST
- IP_TOS
- Simple UDP Clients
- UDPServer
- A UDP Echo Client
- Using DatagramChannel
- Opening a socket
- Receiving
- Sending
- Connecting
- Reading
- Writing
- Closing
- Socket Options // Java 7
- Multicasting
- Multicast Addresses and Groups
- Clients and Servers
- Routers and Routing
- The Constructors
- Communicating with a Multicast Group
- Joining groups
- Leaving groups and closing the connection
- Sending multicast data
- Loopback mode
- Network interfaces
Product information
- Title: Java Network Programming, 4th Edition
- Author(s): Elliotte Rusty Harold
- Release date: October 2013
- Publisher(s): O’Reilly Media, Inc.
- ISBN: 9781449365950
Java network programming
Access-restricted-item true Addeddate 2009-11-24 20:35:24 Boxid IA107313 Boxid_2 CH111101 Camera Canon 5D City Beijing Donor alibris Edition 2nd ed. External-identifier urn:oclc:record:1035925950
urn:lcp:javanetworkprogr00haro:lcpdf:2738c6c9-c588-4f43-914a-f81480518ee7
urn:lcp:javanetworkprogr00haro:epub:4671b237-c4fb-478f-a252-7b2cea45e08d Extramarc Princeton University Library Foldoutcount 0 Identifier javanetworkprogr00haro Identifier-ark ark:/13960/t83j42c16 Isbn 1565928709
9781565928701 Lccn 2001265833 Ocr ABBYY FineReader 8.0 Ocr_converted abbyy-to-hocr 1.1.11 Ocr_module_version 0.0.14 Openlibrary_edition OL15477416M Openlibrary_work OL2022431W Page-progression lr Page_number_confidence 91.66 Pages 770 Ppi 300 Related-external-id urn:isbn:1449357679
urn:oclc:856195814
urn:oclc:857985960
urn:oclc:862113872
urn:oclc:864566482
urn:oclc:864779404
urn:oclc:868128408
urn:oclc:868226946
urn:oclc:862982055
urn:isbn:2841770346
urn:oclc:300370193
urn:oclc:38087063
urn:oclc:468021053
urn:oclc:633396362
urn:isbn:0596520948
urn:oclc:243553892
urn:oclc:863821361
urn:isbn:0585026971
urn:oclc:42854313
urn:oclc:875075298
urn:isbn:0596552580
urn:isbn:1449365957
urn:oclc:861615455
urn:isbn:0596007213
urn:lccn:2005279911
urn:oclc:224078863
urn:oclc:249968183
urn:oclc:318274494
urn:oclc:474922153
urn:oclc:493846464
urn:oclc:506500800
urn:oclc:56695983
urn:oclc:612596134
urn:oclc:614726275
urn:oclc:61688486
urn:oclc:717668882
urn:oclc:760705181
urn:oclc:772696535
urn:oclc:776000055
urn:oclc:781696671
urn:oclc:803514830
urn:oclc:807844550
urn:oclc:850420737
urn:oclc:877680529
urn:isbn:7564100427
urn:oclc:660594852
urn:isbn:1449365965
urn:isbn:1565922271
urn:oclc:301045124
urn:oclc:37027755
urn:oclc:440156695
urn:oclc:474940641
urn:oclc:614447585
urn:oclc:636889062
urn:oclc:716096703
urn:oclc:775979031
urn:oclc:782279255
urn:oclc:799558196
urn:oclc:807248855
urn:oclc:845407681
urn:oclc:862301232
urn:oclc:876505530 Scandate 20091126042152 Scanner scribe11.sfdowntown.archive.org Scanningcenter sfdowntown Worldcat (source edition) 223027459DOWNLOAD OPTIONS
No suitable files to display here.
14 day loan required to access EPUB and PDF files.
IN COLLECTIONS
Uploaded by sf-loaders@archive.org on November 24, 2009
- The Constructors
- Creating Buffers
- Retrieving Specific Header Fields
- Creating New InetAddress Objects