Java Network Programming. Developing Networked Applications. 4th Edition - Helion
ISBN: 978-14-493-6595-0
stron: 506, Format: ebook
Data wydania: 2013-10-04
Księgarnia: Helion
Cena książki: 160,65 zł (poprzednio: 186,80 zł)
Oszczędzasz: 14% (-26,15 zł)
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
Osoby które kupowały "Java Network Programming. Developing Networked Applications. 4th Edition", wybierały także:
- Wprowadzenie do Javy. Programowanie i struktury danych. Wydanie XII 193,23 zł, (59,90 zł -69%)
- Spring i Spring Boot. Kurs video. Testowanie aplikacji i bezpiecze 129,00 zł, (51,60 zł -60%)
- Metoda dziel i zwyci 89,00 zł, (35,60 zł -60%)
- JavaFX. Kurs video. Wzorce oraz typy generyczne 79,00 zł, (31,60 zł -60%)
- Platforma Xamarin. Kurs video. Poziom drugi. Zaawansowane techniki tworzenia aplikacji cross-platform 99,00 zł, (39,60 zł -60%)
Spis treści
Java Network Programming. Developing Networked Applications. 4th Edition eBook -- spis treści
- Java Network Programming
- 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
- 1. Basic Network Concepts
- Networks
- The Layers of a Network
- The Host-to-Network Layer
- The Internet Layer
- The Transport Layer
- The Application Layer
- IP, TCP, and UDP
- IP Addresses and Domain Names
- Ports
- The Internet
- Internet Address Blocks
- Network Address Translation
- Firewalls
- Proxy Servers
- The Client/Server Model
- Internet Standards
- IETF RFCs
- W3C Recommendations
- 2. Streams
- Output Streams
- Input Streams
- Marking and Resetting
- Filter Streams
- Chaining Filters Together
- Buffered Streams
- PrintStream
- Data Streams
- Readers and Writers
- Writers
- OutputStreamWriter
- Readers
- Filter Readers and Writers
- PrintWriter
- 3. Threads
- Running Threads
- Subclassing Thread
- Implementing the Runnable Interface
- Returning Information from a Thread
- Race Conditions
- Polling
- Callbacks
- Futures, Callables, and Executors
- Synchronization
- Synchronized Blocks
- Synchronized Methods
- Alternatives to Synchronization
- Deadlock
- Thread Scheduling
- Priorities
- Preemption
- Blocking
- Yielding
- Sleeping
- Joining threads
- Waiting on an object
- Finish
- Thread Pools and Executors
- Running Threads
- 4. Internet Addresses
- The InetAddress Class
- Creating New InetAddress Objects
- Caching
- Lookups by IP address
- Security issues
- Getter Methods
- Address Types
- Testing Reachability
- Object Methods
- Creating New InetAddress Objects
- Inet4Address and Inet6Address
- The NetworkInterface Class
- Factory Methods
- public static NetworkInterface getByName(String name) throws SocketException
- public static NetworkInterface getByInetAddress(InetAddress address) throws SocketException
- public static Enumeration getNetworkInterfaces() throws SocketException
- Getter Methods
- public Enumeration getInetAddresses()
- public String getName()
- public String getDisplayName()
- Factory Methods
- Some Useful Programs
- SpamCheck
- Processing Web Server Logfiles
- The InetAddress Class
- 5. URLs and URIs
- URIs
- URLs
- Relative URLs
- The URL Class
- Creating New URLs
- Constructing a URL from a string
- Constructing a URL from its component parts
- Constructing relative URLs
- Other sources of URL objects
- Retrieving Data from a URL
- 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
- Splitting a URL into Pieces
- 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()
- Equality and Comparison
- Conversion
- Creating New URLs
- The URI Class
- Constructing a URI
- The Parts of the URI
- Resolving Relative URIs
- Equality and Comparison
- String Representations
- x-www-form-urlencoded
- URLEncoder
- URLDecoder
- Proxies
- System Properties
- The Proxy Class
- The ProxySelector Class
- Communicating with Server-Side Programs Through GET
- Accessing Password-Protected Sites
- The Authenticator Class
- The PasswordAuthentication Class
- The JPasswordField Class
- URIs
- 6. HTTP
- The Protocol
- Keep-Alive
- HTTP Methods
- The Request Body
- Cookies
- CookieManager
- CookieStore
- The Protocol
- 7. URLConnections
- 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()
- Retrieving Arbitrary Header Fields
- 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)
- Retrieving Specific Header Fields
- Caches
- Web Cache for Java
- Configuring the Connection
- protected URL url
- protected boolean connected
- protected boolean allowUserInteraction
- protected boolean doInput
- protected boolean doOutput
- protected boolean ifModifiedSince
- protected boolean useCaches
- Timeouts
- Configuring the Client Request HTTP Header
- Writing Data to a Server
- Security Considerations for URLConnections
- Guessing MIME Media Types
- HttpURLConnection
- The Request Method
- HEAD
- DELETE
- PUT
- OPTIONS
- TRACE
- Disconnecting from the Server
- Handling Server Responses
- Error conditions
- Redirects
- Proxies
- Streaming Mode
- The Request Method
- 8. Sockets for Clients
- Using Sockets
- Investigating Protocols with Telnet
- Reading from Servers with Sockets
- Writing to Servers with Sockets
- Half-closed sockets
- Constructing and Connecting Sockets
- Basic Constructors
- Picking a Local Interface to Connect From
- Constructing Without Connecting
- Socket Addresses
- Proxy Servers
- Getting Information About a Socket
- Closed or Connected?
- toString()
- Setting Socket Options
- TCP_NODELAY
- SO_LINGER
- SO_TIMEOUT
- SO_RCVBUF and SO_SNDBUF
- SO_KEEPALIVE
- OOBINLINE
- SO_REUSEADDR
- IP_TOS Class of Service
- Socket Exceptions
- Sockets in GUI Applications
- Whois
- A Network Client Library
- Using Sockets
- 9. Sockets for Servers
- Using ServerSockets
- Serving Binary Data
- Multithreaded Servers
- Writing to Servers with Sockets
- Closing Server Sockets
- Logging
- What to Log
- How to Log
- Constructing Server Sockets
- Constructing Without Binding
- Getting Information About a Server Socket
- Socket Options
- SO_TIMEOUT
- SO_REUSEADDR
- SO_RCVBUF
- Class of Service
- HTTP Servers
- A Single-File Server
- A Redirector
- A Full-Fledged HTTP Server
- Using ServerSockets
- 10. Secure Sockets
- 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
- 11. Nonblocking I/O
- An Example Client
- An Example Server
- Buffers
- Creating Buffers
- Allocation
- Direct allocation
- Wrapping
- Filling and Draining
- Bulk Methods
- Data Conversion
- View Buffers
- Compacting Buffers
- Duplicating Buffers
- Slicing Buffers
- Marking and Resetting
- Object Methods
- Creating Buffers
- Channels
- SocketChannel
- Connecting
- Reading
- Writing
- Closing
- ServerSocketChannel
- Creating server socket channels
- Accepting connections
- The Channels Class
- Asynchronous Channels (Java 7)
- Socket Options (Java 7)
- SocketChannel
- Readiness Selection
- The Selector Class
- The SelectionKey Class
- 12. UDP
- The UDP Protocol
- UDP Clients
- UDP Servers
- The DatagramPacket Class
- The Constructors
- Constructors for receiving datagrams
- Constructors for sending datagrams
- The get Methods
- public InetAddress getAddress()
- public int getPort()
- public SocketAddress getSocketAddress()
- public byte[] getData()
- public int getLength()
- public int getOffset()
- The setter Methods
- 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
- The DatagramSocket Class
- 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
- Sending and Receiving Datagrams
- 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()
- Managing Connections
- public void connect(InetAddress host, int port)
- public void disconnect()
- public int getPort()
- public InetAddress getInetAddress()
- public InetAddress getRemoteSocketAddress()
- The Constructors
- Socket Options
- SO_TIMEOUT
- SO_RCVBUF
- SO_SNDBUF
- SO_REUSEADDR
- SO_BROADCAST
- IP_TOS
- Some Useful Applications
- Simple UDP Clients
- UDPServer
- A UDP Echo Client
- DatagramChannel
- Using DatagramChannel
- Opening a socket
- Receiving
- Sending
- Connecting
- Reading
- Writing
- Closing
- Socket Options // Java 7
- Using DatagramChannel
- 13. IP Multicast
- Multicasting
- Multicast Addresses and Groups
- Clients and Servers
- Routers and Routing
- Working with Multicast Sockets
- The Constructors
- Communicating with a Multicast Group
- Joining groups
- Leaving groups and closing the connection
- Sending multicast data
- Loopback mode
- Network interfaces
- Two Simple Examples
- Multicasting
- Index
- Colophon
- Copyright