书籍封面
书籍目录
Netty in Action MEAP v05
Copyright
Table of content
Chapter 1: Netty and Java NIO APIs
1.1 Why Netty?
1.1.1 Not all networking frameworks are alike
1.1.2 Netty boasts a rich feature set
1.2 Asynchronous by design
1.2.1 Callbacks
1.3 Blocking versus non-blocking IO on the JVM
1.3.1 EchoServer based on blocking IO
1.3.2 Non-blocking IO basics
1.3.3 EchoServer based on NIO
1.3.4 EchoServer based on NIO.2
1.4 NIO problems and how Netty comes to the rescue
1.4.1 Cross-platform and compatibility issues
1.4.2 Extending ByteBuffer ... or not
1.4.3 Scattering and gathering may leak
1.4.4 Squashing the famous epoll bug
1.5 Summary
Chapter 2: Your first Netty application
2.1 Setting up the development environment
2.2 Netty client and server overview
2.3 Writing an Echo server
2.3.1 Bootstrapping the server
2.3.2 Implementing the server/business logic
2.3.3 Intercepting exceptions
2.4 Writing an echo client
2.4.1 Bootstrapping the client
2.4.2 Implementing the client logic
2.5 Compiling and running the echo client and server
2.5.1 Compiling the server and client
2.5.2 Running the server and client
2.6 Summary
Chapter 3: Netty from the ground up
3.1 Netty Crash Course
3.2 Channels, Events and Input/Output (IO)
3.3 Bootstrapping: What and Why
3.4 Channel Handlers and Data Flow
3.4.1 Piecing it together, ChannelPipeline and handlers
3.5 Encoders, Decoders and Domain Logic: A Closer Look at Handlers
3.6 Summary
Chapter 4: Transports
4.3 Included transports
4.3.1 NIO – Nonblocking I/O
4.3.2 OIO – Old blocking I/O
4.3.3 Local – In VM transport
4.3.4 Embedded transport
4.4 When to use each type of transport
4.5 Summary
Chapter 5: Buffers
5.1 Buffer API
5.2 ByteBuf—The byte data container
5.2.1 How it works
5.2.2 Different types of ByteBuf
5.3 ByteBuf's byte operations
5.3.1 Random access indexing
5.3.2 Sequential access indexing
5.3.3 Discardable bytes
5.3.4 Readable bytes (the actual content)
5.3.5 Writable bytes
5.3.6 Clearing the buffer indexes
5.3.7 Search operations
5.3.8 Mark and reset
5.3.9 Derived buffers
5.3.10 Read/write operations
5.3.11 Other useful operations
5.4 ByteBufHolder
5.4.1 Netty's buffer utility classes
5.4.2 ByteBufAllocator—Allocate ByteBuf when needed
5.4.3 Unpooled—Buffer creation made easy
5.4.4 ByteBufUtil—Small but useful
5.5 Summary
Chapter 6: ChannelHandler
6.1 ChannelPipeline
6.2 ChannelHandlerContext
6.2.1 Notify the next ChannelHandler
6.3 The state model
6.4 ChannelHandlers and their types
6.4.1 ChannelHandler—the parent of all
6.4.2 Inbound handlers
6.4.3 Outbound handlers
Chapter 7: Codec
7.1 Codec
7.2 Decoders
7.2.1 ByteToMessageDecoder
7.2.2 ReplayingDecoder
7.2.3 MessageToMessageDecoder—Decode POJOs on the fly
7.2.4 Decoders summary
7.3 Encoders
7.3.1 MessageToByteEncoder
7.3.2 MessageToMessageEncoder
7.4 Codec
7.4.1 ByteToByteCodec—Decoding and Encoding of bytes
7.4.2 ByteToMessageCodec—Decoding and encoding messages and bytes
7.4.3 MessageToMessageCodec—Decoding and encoding messages
7.5 Other ways to compose
7.5.1 CombinedChannelDuplexHandler—Combine your handlers
7.6 Summary
Chapter 8: Provided ChannelHandlers and codecs
8.1 Securing Netty applications with SSL/TLS
8.2 Building Netty HTTP/HTTPS applications
8.2.1 Netty's HTTP decoder, encoder, and codec
8.2.2 HTTP message aggregation
8.2.3 HTTP compression
8.2.4 Using HTTPS
8.2.5 Using WebSockets
8.2.6 SPDY
8.3 Handling idle connections and timeouts
8.4 Decoding delimiter- and length-based protocols
8.4.1 Delimiter-based protocols
8.4.2 Length-based protocols
8.5 Writing big data
8.6 Serializing data
8.6.1 Serialization via plain JDK
8.6.2 Serialization via JBoss Marshalling
8.6.3 Serialization via ProtoBuf
8.7 Summary
Chapter 9: Bootstrapping Netty applications
9.1 Different types of bootstrapping
9.2 Bootstrapping clients and connectionless protocols
9.2.1 Methods for bootstrapping clients
9.2.2 How to bootstrap a client
9.2.3 Choosing compatible channel implementations
9.3 Bootstrapping Netty servers with ServerBootstrap
9.3.1 Methods for bootstrapping servers
9.3.2 How to bootstrap a server
9.4 Bootstrapping clients from within a channel
9.5 Adding multiple ChannelHandlers during a bootstrap
9.6 Using Netty ChannelOptions and attributes
9.7 Summary
Chapter 10: Unit-test your code
10.1 General
10.2 Testing ChannelHandler
10.2.1 Testing inbound handling of messages
10.2.2 Testing outbound handling of messages
10.3 Testing exception handling
10.4 Summary
Chapter 11: WebSockets
11.1 WebSockets some background
11.2 The Challenge
11.3 Implementation
11.3.1 Handle http requests
11.3.2 Handle websocket frames
11.3.3 Initialize the ChannelPipeline
11.4 Wire things together
11.5 We need encryption, now!
11.6 Summary
Chapter 12: SPDY
12.1 SPDY some background
12.2 The Challenge
12.3 Implementation
12.3.1 Integration with Next Protocol Negotiation
12.3.2 Implementation of the various ChannelHandlers
12.3.3 Setuping the ChannelPipeline
12.3.4 Wiring things together
12.4 Start the SpdyServer and test it
12.5 Summary
Chapter 13: Broadcasting events via UDP
13.1 Handle UDP
13.2 UDP Application structure & Design
13.3 EventLog POJOs
13.4 Writing the “Broadcaster”
13.5 Writing the “monitor”
13.6 Using the LogEventBroadcaster and LogEventMonitor
13.7 Summary
Chapter 14: Implement a custom codec
14.1 Scope of the codec
14.2 Implementing The Memcached codec
14.3 Getting to Know the Memcached Binary Protocol
14.4 Netty Encoders and DEcoders
14.4.1 Implementing the Memcached Encoder
14.4.2 Implementing the Memcached Decoder
14.5 Testing the codec
14.6 Summary
Chapter 15: Choosing the right thread model
15.1 Thread model overview
15.2 The event loop
15.2.1 Using the event loop
15.2.2 I/O operations in Netty 4
15.2.3 I/O operations in Netty 3
15.2.4 Netty’s thread model internals
15.3 Scheduling tasks for later execution
15.3.1 Scheduling tasks with plain Java API
15.3.2 Scheduling tasks using EventLoop
15.3.3 Scheduling implementation internals
15.4 I/O thread allocation in detail
15.5 Summary
Chapter 16: De-register / Re-register with the EventLoop
16.1 Registering and Deregistering Channels and Sockets
16.2 Suspend IO Processing
16.3 Migrate a channel to another event loop
16.4 Summary
没有回复内容