这节课,我想要搞搞清楚,netty里底层read/write究竟是怎样一个模式。read, how, from where, to wherewrite, how, from where, to whereSelectionKeyOP_READ=1OP_WRITE=4OP_CONNECT=8OP_ACCEPT=16Read1. 如果channel有数据可读,那么相应的selectionKey的OP_READ将被置位。2. 准备好buffer(从recvBufferPool中获取预估大小的缓存区),以备读出数据后放置;3. 尝试着从channel中读取数据到buffer中,Reads a seq Read More
posted @ 2012-11-21 22:00 技术草根女 Views(877) Comments(0) Diggs(0) Edit
迷你版的小netty,魂在了:http://rox-xmlrpc.sourceforge.net/niotut/ Read More
posted @ 2012-11-21 20:36 技术草根女 Views(341) Comments(0) Diggs(0) Edit
demo示例ClientServerNio模型model-1model-2model-3model-nettyBossWorkerChannel设计场景connect->read->write->closeinterestOps, selectionKeyOP_READ可读可写. neither read nor write operation has been suspended.OP_WRITE不可读不可写. both has been suspended.OP_READ_WRITE 可读不可写. write operation has been suspended.OP Read More
posted @ 2012-11-21 20:34 技术草根女 Views(1352) Comments(0) Diggs(1) Edit