售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Learning Network Programming with Java
Table of Contents
Learning Network Programming with Java
Credits
About the Author
About the Reviewer
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Getting Started with Network Programming
Network addressing using the InetAddress class
NIO support
Using the URLConnection class
Using the URLConnection class with buffers and channels
The client/server architecture
Creating a simple echo server
Creating a simple echo client
Using Java 8 to support the echo server and client
UDP and multicasting
Creating a multicast server
Creating the multicast client
Scalability
Creating a threaded server
Using the threaded server
Security
Creating a SSL server
Creating an SSL client
Generating secure keys
Summary
2. Network Addressing
Networking basics
Understanding network basics
Network architectures and protocols
Using the NetworkInterface class
Getting a MAC address
Getting a specific MAC address
Getting multiple MAC addresses
Network addressing concepts
URL/URI/URN
Using the URI class
Creating URI instances
Splitting apart a URI
Using the URL class
Creating URL instances
Splitting apart a URL
IP addresses and the InetAddress class
Obtaining information about an address
Address scoping issues
Testing reachability
Introducing the Inet4Address
Private addresses in IPv4
IPv4 address types
The Inet4Address class
Special IPv4 addresses
Introducing the Inet6Address class
Private addresses in IPv6
The Inet6Address class
Special IPv6 addresses
Testing for the IP address type
Using IPv4-compatible IPv6 addresses
Controlling network properties
Summary
3. NIO Support for Networking
Java NIO
Introduction to buffers
Using channels with a time server
Creating a time server
Creating a time client
The chat server/client applications
The chat server
The chat client
Server/client interaction
The HelperMethods class
Handling variable length messages
Running the chat server/client application
Handling multiple clients
The parts server
The parts client handler
The parts client
Running the parts client/server
Asynchronous socket channels
Creating the asynchronous server socket channel server
Creating the asynchronous socket channel client
Other buffer operations
Bulk data transfer
Using a view
Using read-only buffers
Controlling socket options
Summary
4. Client/Server Development
The HTTP protocol structure
The nature of HTTP messages
Initial request line format
Header lines
Message body
Client/Server interaction example
Java socket support for HTTP client/server applications
Building a simple HTTP server
Building a simple HTTP client
Client/server development using standard Java classes
Using the HttpURLConnection class
URL encoding
Using the HTTPServer class
Implementing a simple HTTPServer class
Managing response headers
Open source Java HTTP servers
Server configuration
Handling cookies
Summary
5. Peer-to-Peer Networks
P2P functions/characteristics
Applications-based P2P networks
Java support for P2P applications
Distributed hash tables
DHT components
DHT implementations
Using JDHT
Using FreePastry
The FreePastry demonstration
Understanding the FreePastryExample class
Understanding the FreePastryApplication class
Sending a message to a specific node
Summary
6. UDP and Multicasting
Java support for UDP
TCP versus UDP
UDP client/server
The UDP server application
The UDP client application
The UDP client/server in action
Channel support for UDP
The UDP echo server application
The UDP echo client application
The UDP echo client/server in action
UDP multicasting
The UDP multicast server
The UDP multicast client
The UDP multicast client/server in action
UDP multicasting with channels
The UDP channel multicast server
The UDP channel multicast client
The UDP channel multicast client/server in action
UDP streaming
The UDP audio server implementation
The UDP audio client implementation
Summary
7. Network Scalability
Multithreaded server overview
The thread-per-request approach
The thread-per-request server
The thread-per-request client
The thread-per-request applications in action
Thread-per-connection approach
The thread-per-connection server
The thread-per-connection client
The thread-per-connection applications in action
Thread pools
The ThreadPoolExecutor class characteristics
Simple thread pool server
Simple thread pool client
The thread pool client/server in action
Thread pool with Callable
Using a Callable
Using a Future
Using the HttpServer executor
Using a selector
Creating the selector
Registering a channel
Using the selector to support a time client/server
The channel time server
The date and time client application
The date and time server/client in action
Handling network timeouts
Summary
8. Network Security
Security
Secure communication terminology
Encryption basics
Symmetric encryption techniques
Generating a key
Encrypting text using a symmetric key
Decrypting text
Asymmetric encryption techniques
Generating and saving asymmetric keys
Encrypting/decrypting text using an asymmetric key
Saving asymmetric keys to a file
Creating a keystore
Creating and maintaining a keystore with keytool
Keytool command-line arguments
Creating and maintaining a keystore with Java
Symmetric encryption client/server
Symmetric server application
Symmetric client application
Symmetric client/server in action
Asymmetric encryption client/server
Asymmetric server application
Asymmetric client application
Asymmetric client/server in action
TLS/SSL
SSL server
SSL client
SSL client/server in action
Secure hash functions
Summary
9. Network Interoperability
Byte order in Java
Interfacing with other languages
Interfacing with JVM based languages
Interfacing with non-JVM languages
Communication through simple sockets
The Java server
The C# client
The client/server in action
Interoperability through middleware
Creating a RESTful service
Testing the RESTful service
Creating a RESTful client
Summary
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜