netty
2014-12-04 17:00:06 41 举报
登录查看完整内容
netty ServerSocket bind 过程
作者其他创作
大纲/内容
UpstreamChannelStateEvent(open state)
step1.add handlerto pipeline
step2.fireChannelOpen
step1.创建ChannelStatEvent
构造NioServerSocketChannel
loop proess task
push
NioServerSocketPipelineSink
NioServerBoss
NettyServerSocket的bind异步Future await
DownstreamChannelStateEventbound state
私有类Binder(SimpleChannelUpstreamHandler)
step2.调用handler处理事件
Channels
依赖
tailChannelHandlerContext
start Boss Runnable
NioWorkerPoolcore*2 NW
ChannelPipelineFactory(用户定义)
poll
ChannelFuture
ChannelFutureListener.notifyuListeners()
step1.open
ServerBootstrap.bind(用户定义)
setSuccess
Task QueueConcurrentLinkedQueue
NIO ServerSocketChannel.open()
ServerSocketChannel
ChannelPipeline.sendUpstream
Channels.bind
step2.使用factory创建channel
ChannelPipeline.sendDownstream
head ChannelHandlerContext
eventSunk处理bound事件
fireChannelBound
NioServerBoss.bind
NioServerBossPooldefault 1 NSB
创建pipeline并send
ServerSocketChannel.bind
newChannel
ChannelFuture
Interceptor chain(handles list)
selecor
NioServerSocketChannelFactory(用户定义)
UpstreamChannelStateEvent(bound state)
open selector
wakeup
0 条评论
回复 删除
下一页