Java网络编程.pdf

Java网络编程.pdf
 

书籍描述

内容简介
《Java网络编程(第4版)(影印版)(英文版)》完整介绍了基于Java开发网络程序。你将了解到如何使用Java的网络类库来快速简便地完成常见的网络任务,比如编写多线程服务器、加密通信、在局域网进行广播和发送数据到服务器端程序。作者Elliotte Rusty Harold提供了完整有效的程序来阐明他所描述的方法和类。这本全新修订的第4版包括了REST、SPDY、异步I/O和很多其他最新技术。

编辑推荐
《Java网络编程(第4版)(影印版)(英文版)》由东南大学出版社出版。

作者简介
作者:(美国)哈罗德(Elliotte Rusty Harold)

目录
Preface
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
Thread Pools and Executors
4.Internet Addresses.
The InetAddress Class
Creating New InetAddress Objects
Getter Methods
Address Types
Testing Reachability
Object Methods
Inet4Address and Inet6Address
The Networklnterface Class
Factory Methods
Getter Methods
Some Useful Programs
SpamCheck
Processing Web Server Logfiles
5.URLs and URls
URIs
URLs
Relative URLs
The URL Class
Creating New URLs
Retrieving Data from a URL
Splitting a URL into Pieces
Equality and Comparison
Conversion
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
6.HTTP
The Protocol
Keep—Alive
HTTP Methods
The Request Body
Cookies
CookieManager
CookieStore
7.URLConnections
Opening URLConnections
Reading Data from a Server
Reading the Header
Retrieving Specfic Header Fields
Retrieving Arbitrary Header Fields
Caches
Web Cache for Java
Configuring the Connection
protected URL url
protected boolean connected
protected boolean allowUserlnteraction
protected boolean dolnput
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
Disconnecting from the Server
Handling Server Responses
Proxies
Streaming Mode
8.Sockets for Clients
Using Sockets
Investigating Protocols with Telnet
Reading from Servers with Sockets
Writing to Servers with 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
……
9.Sockets for Servers
10.Secure Sockets
11.Nonblocking I/O
12.UDP
13.IP Multicast
Index

文摘
版权页:



Because of the increasing scarcity of and demand for raw IP addresses, most networks today use Network Address Translation (NAT).In NAT-based networks most nodes only have local, non-routable addresses selected from either 10.x.x.x, 172.16.x.x to 172.31.x.x, or 192.168.x.x.The routers that connect the local networks to the ISP translate these local addresses to a much smaller set of routable addresses.
For instance, the dozen or so IP nodes in my apartment all share a single externally visibleIP address.The computer on which I'm typing this has the IP address 192.168.1.5, but on your network that address may refer to a completely different host, ifit exists at all.Nor could you reach my computer by sending data to 192.168.1.5.Instead, you'd have to send to 216.254.85.72 (and even then, the data would only get through if I had configured my NAT router to pass incoming connections on to 192.168.1.5).
The router watches my outgoing and incoming connections and adjusts the addresses in the IP packets.For an outgoing packet,it changes the source address to the router's external address (216.254.85.72 on my network).For an incoming packet, it changes the destination address to one of the local addresses, such as 192.168.1.12.Exactly how it keeps track of which connections come from and are aimed at which internal computers is not particularly important to a Java programmer.As long as your machines are configured properly, this process is mostly transparent.You just need to remember that the external and internal addresses may not be the same.
Eventually, IPv6 should make most of this obsolete.NAT will be pointless, though firewalls will still be useful.Subnets will still exist for routing, but they'll be much larger.

购买书籍

当当网购书 京东购书 卓越购书

PDF电子书下载地址

相关书籍

搜索更多