Java_NIO框架Netty教程.rar

  • pengv
    了解作者
  • Java
    开发工具
  • 1.5MB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 3
    下载次数
  • 2018-09-26 08:17
    上传日期
java NIO书籍,Java_NIO框架的Netty的入门教程
Java_NIO框架Netty教程.rar
  • Java_NIO框架Netty教程.pdf
    2.3MB
内容介绍
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"> <meta name="generator" content="pdf2htmlEX"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <link rel="stylesheet" href="https://static.pudn.com/base/css/base.min.css"> <link rel="stylesheet" href="https://static.pudn.com/base/css/fancy.min.css"> <link rel="stylesheet" href="https://static.pudn.com/prod/directory_preview_static/62512c786caf5961923b5587/raw.css"> <script src="https://static.pudn.com/base/js/compatibility.min.js"></script> <script src="https://static.pudn.com/base/js/pdf2htmlEX.min.js"></script> <script> try{ pdf2htmlEX.defaultViewer = new pdf2htmlEX.Viewer({}); }catch(e){} </script> <title></title> </head> <body> <div id="sidebar" style="display: none"> <div id="outline"> </div> </div> <div id="pf1" class="pf w0 h0" data-page-no="1"><div class="pc pc1 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/62512c786caf5961923b5587/bg1.jpg"><div class="t m0 x1 h2 y1 ff1 fs0 fc0 sc0 ls0 ws0">Java NIO<span class="_ _0"> </span><span class="ff2 sc1">&#26694;&#26550;<span class="_ _1"> </span></span>Netty<span class="_ _0"> </span><span class="ff2 sc1">&#25945;&#31243;&#65288;&#19968;&#65289;</span> <span class="_ _0"> </span><span class="ff3">&#8211;</span> Hello<span class="_ _2"></span> Netty<span class="ff4 fc1"> </span></div><div class="t m0 x1 h3 y2 ff2 fs1 fc1 sc0 ls0 ws0">&#20808;&#21872;&#21990;&#20004;&#21477;&#65292;&#22914;&#26524;&#20320;&#36824;<span class="_ _3"></span>&#19981;&#30693;&#36947;<span class="_ _1"> </span><span class="ff5">Ne<span class="_ _3"></span>tty<span class="_"> </span></span>&#26159;&#20570;&#20160;&#20040;&#30340;&#33021;&#20570;&#20160;<span class="_ _3"></span>&#20040;&#12290;&#37027;&#21487;&#20197;&#20808;&#31616;&#21333;&#30340;<span class="_ _3"></span>&#25628;&#32034;&#20102;&#35299;&#19968;&#19979;&#12290;&#25105;<span class="_ _3"></span>&#21482;&#33021;&#35828;<span class="_ _1"> </span><span class="ff5">Ne<span class="_ _3"></span>tty<span class="_"> </span></span>&#26159;&#19968;&#20010;<span class="_ _1"> </span><span class="ff5">NIO<span class="_"> </span></span>&#30340;&#26694;&#26550;<span class="_ _3"></span>&#65292;&#21487;&#20197;&#29992;</div><div class="t m0 x1 h3 y3 ff2 fs1 fc1 sc0 ls0 ws0">&#20110;&#24320;&#21457;&#20998;&#24067;&#24335;&#30340;<span class="_ _0"> </span><span class="ff5">Java<span class="_ _0"> </span></span>&#31243;&#24207;&#12290;&#20855;<span class="_ _3"></span>&#20307;&#33021;&#20570;&#20160;&#20040;&#65292;&#21508;&#20301;<span class="_ _3"></span>&#21487;&#20197;&#23613;&#37327;&#21457;&#25381;&#24819;&#35937;&#12290;<span class="_ _3"></span>&#25216;&#26415;&#65292;&#26159;&#26381;&#21153;&#20110;&#20154;<span class="_ _3"></span>&#32780;&#19981;&#26159;&#23616;&#38480;&#20303;&#20154;&#30340;&#12290;<span class="_ _3"></span><span class="ff6"> </span></div><div class="t m0 x1 h4 y4 ff5 fs1 fc1 sc0 ls0 ws0"> </div><div class="t m0 x1 h3 y5 ff5 fs1 fc1 sc0 ls0 ws0">Netty<span class="_ _0"> </span><span class="ff2">&#30340;&#31616;&#20171;&#21644;&#19979;&#36733;&#21487;&#21442;&#32771;<span class="_ _3"></span>&#65306;&#12298;<span class="fc0">&#24320;&#28304;<span class="_ _0"> </span><span class="ff5">Java<span class="_"> </span></span>&#39640;&#24615;&#33021;<span class="_ _4"> </span><span class="ff5 ls1">NIO<span class="_ _4"> </span></span>&#26694;&#26550;&#25512;<span class="_ _3"></span>&#33616;<span class="ff5"> <span class="_ _5"> </span><span class="ff7">&#8211;</span> Netty</span></span>&#12299;&#12290;<span class="_ _3"></span>&#27880;&#24847;&#65292;&#27492;&#26102;&#30340;&#26368;&#26032;<span class="_ _3"></span>&#29256;&#24050;&#32463;&#20026;<span class="_ _0"> </span></span>3.5.2.Final<span class="ff2">&#12290;<span class="_ _3"></span></span> </div><div class="t m0 x1 h4 y6 ff5 fs1 fc1 sc0 ls0 ws0"> </div><div class="t m0 x1 h3 y7 ff2 fs1 fc1 sc0 ls0 ws0">&#22914;&#26524;&#20320;&#24050;&#32463;&#19975;&#20107;&#20855;&#22791;&#65292;&#37027;&#20040;&#25105;&#20204;&#20808;&#20174;&#19968;<span class="_ _3"></span>&#27573;&#20195;&#30721;&#24320;&#22987;&#12290;<span class="_ _2"></span>&#31243;&#24207;&#21592;&#20204;&#20064;&#24815;&#30340;<span class="_ _3"></span>&#19978;&#25163;&#31532;&#19968;&#27493;&#65292;&#33258;&#28982;&#26159;<span class="ff5">"Hello <span class="_ _2"></span>world"<span class="ff2">&#65292;&#19981;&#36807;<span class="_ _4"> </span></span>Netty<span class="_"> </span><span class="ff2">&#23448;&#32593;&#30340;&#20363;&#23376;&#21364;&#20559;&#20559;&#25243;</span></span></div><div class="t m0 x1 h3 y8 ff2 fs1 fc1 sc0 ls0 ws0">&#24323;&#20102;<span class="ff5">"Hello world"</span>&#12290;&#37027;<span class="_ _3"></span>&#25105;&#20204;&#23601;&#33258;&#24049;&#20889;&#19968;<span class="_ _3"></span>&#20010;&#26368;&#31616;&#21333;&#30340;<span class="ff5">"He<span class="_ _3"></span>llo world"</span>&#30340;&#20363;&#23376;&#65292;&#20316;<span class="_ _3"></span>&#20026;&#19978;&#25163;&#12290;<span class="ff5"> </span></div><div class="t m0 x1 h4 y9 ff5 fs1 fc2 sc0 ls0 ws0">?<span class="fc1"> </span></div><div class="c x1 ya w2 h5"><div class="t m0 x2 h6 yb ff8 fs2 fc3 sc0 ls0 ws0">HelloServer.java </div></div><div class="c x1 yc w3 h7"><div class="t m0 x0 h6 yd ff8 fs2 fc3 sc0 ls2 ws0">01<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 ye ff8 fs2 fc3 sc0 ls2 ws0">02<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 yf ff8 fs2 fc3 sc0 ls2 ws0">03<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 y10 ff8 fs2 fc3 sc0 ls2 ws0">04<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 y11 ff8 fs2 fc3 sc0 ls2 ws0">05<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 y12 ff8 fs2 fc3 sc0 ls2 ws0">06<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 y13 ff8 fs2 fc3 sc0 ls2 ws0">07<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 y14 ff8 fs2 fc3 sc0 ls2 ws0">08<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 y15 ff8 fs2 fc3 sc0 ls2 ws0">09<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 y16 ff8 fs2 fc3 sc0 ls2 ws0">10<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 y17 ff8 fs2 fc3 sc0 ls2 ws0">11<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 y18 ff8 fs2 fc3 sc0 ls2 ws0">12<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 y19 ff8 fs2 fc3 sc0 ls2 ws0">13<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 y1a ff8 fs2 fc3 sc0 ls2 ws0">14<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 y1b ff8 fs2 fc3 sc0 ls2 ws0">15<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 y1c ff8 fs2 fc3 sc0 ls2 ws0">16<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 y1d ff8 fs2 fc3 sc0 ls2 ws0">17<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 y1e ff8 fs2 fc3 sc0 ls2 ws0">18<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 y1f ff8 fs2 fc3 sc0 ls2 ws0">19<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 y20 ff8 fs2 fc3 sc0 ls2 ws0">20<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 y21 ff8 fs2 fc3 sc0 ls2 ws0">21<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 y22 ff8 fs2 fc3 sc0 ls2 ws0">22<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 y23 ff8 fs2 fc3 sc0 ls2 ws0">23<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 y24 ff8 fs2 fc3 sc0 ls2 ws0">24<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 y25 ff8 fs2 fc3 sc0 ls2 ws0">25<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 y26 ff8 fs2 fc3 sc0 ls2 ws0">26<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 y27 ff8 fs2 fc3 sc0 ls2 ws0">27<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 y28 ff8 fs2 fc3 sc0 ls2 ws0">28<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 y29 ff8 fs2 fc3 sc0 ls2 ws0">29<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 y2a ff8 fs2 fc3 sc0 ls2 ws0">30<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 y2b ff8 fs2 fc3 sc0 ls2 ws0">31<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 y2c ff8 fs2 fc3 sc0 ls2 ws0">32<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 y2d ff8 fs2 fc3 sc0 ls2 ws0">33<span class="ls0"><span class="fc4 sc0"> </span></span></div><div class="t m0 x0 h6 yb ff8 fs2 fc3 sc0 ls2 ws0">34<span class="ls0"><span class="fc4 sc0"> </span></span></div></div><div class="c x3 yc w4 h7"><div class="t m0 x0 h6 yd ff8 fs2 fc3 sc0 ls2 ws0">/**<span class="ls0"> </span></div><div class="t m0 x0 h6 ye ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span>* Netty <span class="ff2">&#26381;&#21153;&#31471;&#20195;&#30721;</span> </div><div class="t m0 x0 h6 yf ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span><span class="ls2">* </span> </div><div class="t m0 x0 h6 y10 ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span>* @author lihzh </div><div class="t m0 x0 h6 y11 ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span>* @alia OneCoder </div><div class="t m0 x0 h6 y12 ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span>* @blog <span class="fc2">http://www.coderli.com</span> </div><div class="t m0 x0 h6 y13 ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span><span class="ls2">*/</span> </div><div class="t m0 x0 h6 y14 ff8 fs2 fc3 sc0 ls0 ws0">public class HelloServer { </div><div class="t m0 x0 h6 y15 ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span> </div><div class="t m0 x0 h6 y16 ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span>public static void main(String args[]) { </div><div class="t m0 x0 h6 y17 ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span>// Server<span class="_ _1"> </span><span class="ff2">&#26381;&#21153;&#21551;&#21160;&#22120;</span> </div><div class="t m0 x0 h6 y18 ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span>ServerBootstrap bootstrap = new ServerBootstrap( </div><div class="t m0 x0 h6 y19 ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span><span class="ls2">new</span> NioServerSocketChannelFactory( </div><div class="t m0 x0 h6 y1a ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span>Executors.newCachedThreadPool(), </div><div class="t m0 x0 h6 y1b ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span>Executors.newCachedThreadPool()));<span class="fc4 sc0"> </span></div><div class="t m0 x0 h6 y1c ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span><span class="ls2">// </span><span class="ff2">&#35774;&#32622;&#19968;&#20010;&#22788;&#29702;&#23458;&#25143;&#31471;&#28040;&#24687;&#21644;&#21508;&#31181;&#28040;&#24687;&#20107;&#20214;&#30340;&#31867;</span>(Handler) </div><div class="t m0 x0 h6 y1d ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span>bootstrap </div><div class="t m0 x0 h6 y1e ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span>.setPipelineFactory(new ChannelPipelineFactory() {<span class="fc4 sc0"> </span></div><div class="t m0 x0 h6 y1f ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span>@Override </div><div class="t m0 x0 h6 y20 ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span>public ChannelPipeline getPipeline() </div><div class="t m0 x0 h6 y21 ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span>throws Exception { </div><div class="t m0 x0 h6 y22 ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span>return Channels </div><div class="t m0 x0 h6 y23 ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span>.pipeline(new </div><div class="t m0 x0 h6 y24 ff8 fs2 fc3 sc0 ls0 ws0">HelloServerHandler()); </div><div class="t m0 x0 h6 y25 ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span>} </div><div class="t m0 x0 h6 y26 ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span><span class="ls2">});</span> </div><div class="t m0 x0 h6 y27 ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span><span class="ls2">// <span class="ff2 ls3">&#24320;&#25918;<span class="_ _6"> </span></span></span>8000<span class="_ _1"> </span><span class="ff2">&#31471;&#21475;&#20379;&#23458;&#25143;&#31471;&#35775;&#38382;&#12290;</span> </div><div class="t m0 x0 h6 y28 ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span>bootstrap.bind(new InetSocketAddress(8000)); </div><div class="t m0 x0 h6 y29 ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span>} </div><div class="t m0 x0 h6 y2a ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span> </div><div class="t m0 x0 h6 y2b ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span>private static class HelloServerHandler extends </div><div class="t m0 x0 h6 y2c ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span>SimpleChannelHandler { </div><div class="t m0 x0 h6 y2d ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span> </div><div class="t m0 x0 h6 yb ff8 fs2 fc3 sc0 ls0 ws0"> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span> <span class="_"> </span><span class="ls2">/**</span> </div></div><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a></div><div class="pi" data-data='{"ctm":[1.611792,0.000000,0.000000,1.611792,0.000000,0.000000]}'></div></div> </body> </html>
评论
    相关推荐
    • Java.nio
      NULL 博文链接:https://shihuan830619.iteye.com/blog/1159544
    • mina:Java Nio Apache Mina Java Nio
      java-nio java-nio 通道表示到实体,如硬件设备、文件、网络套接字或可以执行一个或多个不同 I/O 操作(如读取或写入)的程序组件的开放的连接。 在以往的java的IO操作的过程中都是面向字节流操作,并且读写操作是...
    • java NIO socket聊天室
      使用NIO socket不需要多线程来处理多个连接的请求,效率非常高 可以作为NIO socket入门的例子,Reactor模式,重点理解key.attach, jar文件里包含了源代码 ...5,封装自己的协议可以做成自己需要的服务器端程序
    • java socket Bio Nio example
      几个用java写的小程序,实现了bio和nio
    • JAVA NIO 聊天室程序
      1.大学时的一个聊天室程序,这几天刚有时间,将服务端改为NIO机制 2.支持多人同时在线局域网聊天 3.知识面:JSwing,NIO,消息包加密,解密,单列模式的线程安全机制等.
    • javaNIO实例
      该资源包含了一个用javaNIO实现的读写文件以及复制文件的简单的demo,程序注释清晰,简单易懂,喜欢的下载!!!
    • java nio 读文件
      java nio 读文件,java nio 读文件
    • java nio示例代码
      该资源为Java nio入门的部分简单示例代码,目的是用简单的示例程序,说明nio中的知识点,希望对你的学习有所帮助
    • java NIOjava并发编程的书籍
      java NIOjava并发编程的书籍java NIOjava并发编程的书籍java NIOjava并发编程的书籍java NIOjava并发编程的书籍java NIOjava并发编程的书籍java NIOjava并发编程的书籍java NIOjava并发编程的书籍java...
    • Java NIO.pdf
      Java 网络编程 非阻塞IO的绝佳参考书