File tree Expand file tree Collapse file tree 7 files changed +157
-80
lines changed Expand file tree Collapse file tree 7 files changed +157
-80
lines changed Original file line number Diff line number Diff line change @@ -25,8 +25,9 @@ Netty是Java世界知名的网络应用框架。本系列文章是Netty的源码
25
25
### [ 1.概述] ( https://github.com/code4craft/netty-learning/blob/master/ch1-overview.md )
26
26
### [ 2.Netty中的buffer] ( https://github.com/code4craft/netty-learning/blob/master/ch2-buffer.md )
27
27
### [ 3.层层分析Netty中的Channel(上)] ( https://github.com/code4craft/netty-learning/blob/master/ch3-pipeline.md )
28
- ### [ 4.层层分析Netty中的Channel(下)] ( https://github.com/code4craft/netty-learning/blob/master/ch4-channel-nio.md ) * 未完成*
29
- ### [ 5.分门别类讲讲Handler] ( https://github.com/code4craft/netty-learning/blob/master/ch5-handler.md ) * 未完成*
28
+ ### [ 4.层层分析Netty中的Channel(上)] ( https://github.com/code4craft/netty-learning/blob/master/ch4-pipeline.md )
29
+ ### [ 5.层层分析Netty中的Channel(下)] ( https://github.com/code4craft/netty-learning/blob/master/ch5-channel-nio.md ) * 未完成*
30
+ ### [ 6.分门别类讲讲Handler] ( https://github.com/code4craft/netty-learning/blob/master/ch6-handler.md ) * 未完成*
30
31
31
32
## 二、Netty中的特性与细节
32
33
@@ -54,11 +55,11 @@ twitter关于3.0与4.0中Channel Event的说明:
54
55
55
56
## 使用Netty的开源项目:
56
57
57
- * ### [ dubbo ] ( https://github.com/alibaba/dubbo )
58
+ * ### [ Dubbo ] ( https://github.com/alibaba/dubbo )
58
59
59
60
阿里巴巴的RPC中间件。支持Netty和Mina。
60
61
61
- * ### [ finagle ] ( https://github.com/twitter/finagle )
62
+ * ### [ Finagle ] ( https://github.com/twitter/finagle )
62
63
63
64
Twitter的RPC中间件。使用Scala编写。
64
65
Original file line number Diff line number Diff line change @@ -133,3 +133,7 @@ PS: Pipeline这部分拖了两个月,终于写完了。中间写的实在缓
133
133
[ 1 ] : http://static.oschina.net/uploads/space/2013/0921/174032_18rb_190591.png
134
134
[ 2 ] : http://static.oschina.net/uploads/space/2013/1109/075339_Kjw6_190591.png
135
135
[ 3 ] : http://static.oschina.net/uploads/space/2013/1124/001528_TBb5_190591.jpg
136
+
137
+ 参考资料:
138
+
139
+ * Sink [ http://en.wikipedia.org/wiki/Sink_\(computing\) ] ( http://en.wikipedia.org/wiki/Sink_\( computing\) )
Original file line number Diff line number Diff line change
1
+ 层层分析Netty中的Channel(中)
2
+ --------
3
+
4
+ 上篇文章讲到了Netty的Channel内部的运作机制,这篇文章详细分析Channel的生命周期。
5
+
6
+ ## 一、连接的创建
7
+
8
+ ### 上层世界:Netty中Channel的类型及创建
9
+
10
+ 我们在使用Netty时,总是需要指定一个` ChannelFactory ` ,这个就是
11
+
12
+ Bind: ` NioServerSocketChannel `
13
+
14
+ Accept:` NioServerBoss `
15
+
16
+ Read:` NioWorker.read `
17
+
18
+ Write:` AbstractNioWorker `
19
+
20
+ ### 下层世界:NIO中的
21
+
22
+ | NIO | Netty |
23
+ | -| -|
24
+ | SelectionKey.OP_READ | |
25
+ | SelectionKey.OP_WRITE | |
26
+ | SelectionKey.OP_CONNECT | |
27
+ | SelectionKey.OP_ACCEPT | |
28
+
29
+
30
+
31
+
32
+ ## 二、Interest与Selector
33
+
34
+ ## 三、服务器端的多线程
35
+
36
+ ## 回到现实:几种与对应的实现
37
+
38
+ ## NIO:
39
+
40
+ Selector ->Boss
41
+ ->Worker
42
+
43
+
44
+ 实际上Channel部分没有太多内容,
45
+
46
+ > TODO
47
+
48
+ ServerChannel
49
+
50
+ SocketChannel
51
+
52
+ DatagramChannel
53
+
54
+ LocalChannel
55
+
56
+ ----------
57
+
58
+ ChannelHandler
59
+
60
+ ChannelUpstreamHandler
61
+
62
+ ChannelDownstreamHandler
63
+
64
+ Config Parent & Child
65
+
66
+ 通过handler把底层隔离了
67
+
68
+ ![ Multiple Reactors] [ 1 ]
69
+
70
+ [ 1 ] : http://static.oschina.net/uploads/space/2013/1125/130828_uKWD_190591.jpeg
71
+
72
+ 参考资料:
73
+
74
+ * Scalable IO in Java [ http://gee.cs.oswego.edu/dl/cpjslides/nio.pdf ] ( http://gee.cs.oswego.edu/dl/cpjslides/nio.pdf )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ 层层分析Netty中的Channel(下)
2
+ --------
3
+
4
+ 上篇文章讲到了Netty的Channel内部的运作机制和生命周期。这篇文章会走进Netty处理的内部,结合NIO,讲讲Netty中是如何实现Reactor模式的。
5
+
6
+ ## 一、连接的创建
7
+
8
+ ### 上层世界:Netty中Channel的类型及创建
9
+
10
+ 我们在使用Netty时,总是需要指定一个` ChannelFactory ` ,这个就是
11
+
12
+ Bind: ` NioServerSocketChannel `
13
+
14
+ Accept:` NioServerBoss `
15
+
16
+ Read:` NioWorker.read `
17
+
18
+ Write:` AbstractNioWorker `
19
+
20
+ ### 下层世界:NIO中的
21
+
22
+ | NIO | Netty |
23
+ | -| -|
24
+ | SelectionKey.OP_READ | |
25
+ | SelectionKey.OP_WRITE | |
26
+ | SelectionKey.OP_CONNECT | |
27
+ | SelectionKey.OP_ACCEPT | |
28
+
29
+
30
+
31
+
32
+ ## 二、Interest与Selector
33
+
34
+ ## 三、服务器端的多线程
35
+
36
+ ## 回到现实:几种与对应的实现
37
+
38
+ ## NIO:
39
+
40
+ Selector ->Boss
41
+ ->Worker
42
+
43
+
44
+ 实际上Channel部分没有太多内容,
45
+
46
+ > TODO
47
+
48
+ ServerChannel
49
+
50
+ SocketChannel
51
+
52
+ DatagramChannel
53
+
54
+ LocalChannel
55
+
56
+ ----------
57
+
58
+ ChannelHandler
59
+
60
+ ChannelUpstreamHandler
61
+
62
+ ChannelDownstreamHandler
63
+
64
+ Config Parent & Child
65
+
66
+ 通过handler把底层隔离了
67
+
68
+ ![ Multiple Reactors] [ 1 ]
69
+
70
+ [ 1 ] : http://static.oschina.net/uploads/space/2013/1125/130828_uKWD_190591.jpeg
71
+
72
+ 参考资料:
73
+
74
+ * Scalable IO in Java [ http://gee.cs.oswego.edu/dl/cpjslides/nio.pdf ] ( http://gee.cs.oswego.edu/dl/cpjslides/nio.pdf )
File renamed without changes.
You can’t perform that action at this time.
0 commit comments