⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 j-chat-4-1.html

📁 在这篇免费的 dW 专有的独家教程中
💻 HTML
📖 第 1 页 / 共 2 页
字号:
        var bottompreviousover=new Image(77,15);
        var bottompreviousout=new Image(77,15);
        var topnextover=new Image(60,15);
        var topnextout=new Image(60,15);
        var bottomnextover=new Image(60,15);
        var bottomnextout=new Image(60,15);
        var topnextsectionover=new Image(108,15);
        var topnextsectionout=new Image(108,15);
        var bottomnextsectionover=new Image(108,15);
        var bottomnextsectionout=new Image(108,15);
      
    menu1over.src="imagemaster/himenu1.jpg"; 
menu1out.src="imagemaster/menu1.jpg"; 
menu2over.src="imagemaster/himenu2.jpg"; 
menu2out.src="imagemaster/menu2.jpg"; 
menu3over.src="imagemaster/himenu3.jpg"; 
menu3out.src="imagemaster/menu3.jpg"; 
menu4over.src="imagemaster/himenu4.jpg"; 
menu4out.src="imagemaster/menu4.jpg"; 
menu5over.src="imagemaster/himenu5.jpg"; 
menu5out.src="imagemaster/menu5.jpg"; 
menu6over.src="imagemaster/himenu6.jpg"; 
menu6out.src="imagemaster/menu6.jpg"; 
menu7over.src="imagemaster/himenu7.jpg"; 
menu7out.src="imagemaster/menu7.jpg"; 
menu8over.src="imagemaster/himenu8.jpg"; 
menu8out.src="imagemaster/menu8.jpg"; 
menu9over.src="imagemaster/himenu9.jpg"; 
menu9out.src="imagemaster/menu9.jpg"; 
menu10over.src="imagemaster/himenu10.jpg"; 
menu10out.src="imagemaster/menu10.jpg"; 
menu11over.src="imagemaster/himenu11.jpg"; 
menu11out.src="imagemaster/menu11.jpg"; 
menu12over.src="imagemaster/himenu12.jpg"; 
menu12out.src="imagemaster/menu12.jpg"; 

        var mainblurb="Main menu";
        var sectionblurb="Section menu";
        var feedbackblurb="Give feedback on this tutorial";
        var previousblurb="Go to previous panel";
        var nextblurb="Go to next panel";
        var nextsectionblurb="Go to next section";

        topmainover.src="../i/h-main.gif";
        topmainout.src="../i/main.gif";
        bottommainover.src="../i/h-main.gif";
        bottommainout.src="../i/main.gif";
        topsectionover.src="../i/h-section.gif";
        topsectionout.src="../i/section.gif";      
        bottomsectionover.src="../i/h-section.gif";
        bottomsectionout.src="../i/section.gif";      
        topfeedbackover.src="../i/h-feedback.gif";
        topfeedbackout.src="../i/feedback.gif";
        bottomfeedbackover.src="../i/h-feedback.gif";
        bottomfeedbackout.src="../i/feedback.gif";
        toppreviousover.src="../i/h-previous.gif";
        toppreviousout.src="../i/previous.gif";
        bottompreviousover.src="../i/h-previous.gif";
        bottompreviousout.src="../i/previous.gif";
        topnextover.src="../i/h-next.gif";
        topnextout.src="../i/next.gif";
        bottomnextover.src="../i/h-next.gif";
        bottomnextout.src="../i/next.gif";
        topnextsectionout.src="../i/nextsection.gif";
        topnextsectionover.src="../i/h-nextsection.gif";
        bottomnextsectionout.src="../i/nextsection.gif";
        bottomnextsectionover.src="../i/h-nextsection.gif";
      }
      function iOut(image)
      {
        if (browser=="N3")document[image].src=eval(image + "out.src");
      }
      function iOver(image)
      {
        if (browser=="N3")document[image].src=eval(image + "over.src");
      }
     // --></script><!--<script src="../i/emailfriend.js" language="javascript"></script>--><a href="#navskip"><img border="0" alt="跳至主目录" src="../i/c.gif"></a><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr bgcolor="#006699"><td width="300"><table cellpadding="0" cellspacing="0" border="0" width="300"><tr bgcolor="#006699"><td width="150"><img height="25" width="150" alt="IBM" src="../i/mast_logo.gif"></td><td background="../i/mgradient.gif" width="150"><font face="宋体" color="#99ccff" size="2"><b>中国&nbsp;</b></font><br><img alt="" height="1" width="150" src="../i/c.gif"></td></tr></table></td><td width="300" align="left"><table width="300" border="0" cellspacing="0" cellpadding="0"><tr><td width="100"><a href="/cgi-bin/click.p?url=http://www.ibm.com/cn/shop"><img border="0" src="../i/shopibm.gif" width="100" height="25" alt="购物"/></a></td><td width="100"><a href="/cgi-bin/click.p?url=http://www.ibm.com/cn/support"><img border="0" src="../i/support_chs.gif" width="100" height="25" alt="技术支持"/></a></td><td width="100"><a href="/cgi-bin/click.p?url=http://www.ibm.com/cn/support/product"><img border="0" src="../i/downloads_chs.gif" width="100" height="25" alt="免费下载"/></a></td></tr></table></td></tr></table><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr bgcolor="#000000"><td><table width="600" border="0" cellspacing="0" cellpadding="0"><tr><td bgcolor="#006699" width="150"><img src="../i/mast_lnav_sp.gif" width="150" height="21" alt=""/></td><td colspan="4" bgcolor="#000000"><table border="0" cellspacing="0" cellpadding="0" height="21"><tr><td height="21" bgcolor="#000000" width="79" align="center"><a class="nav" style="color: #ffffff;" href="/cgi-bin/click.p?url=http://www.ibm.com/cn"><font size="2" color="#ffffff" face="宋体"><b>IBM 主页</b></font></a></td><td width="1" bgcolor="#959595"><img src="../i/c.gif" width="1" height="1" alt=""/></td><td height="21" bgcolor="#000000" width="74" align="center"><a class="nav" style="color: #ffffff;" href=/cgi-bin/click.p?url=http://www.ibm.com/cn/products><font size="2" color="#ffffff" face="宋体"><b>产品</b></font></a></td><td bgcolor="#959595" width="1"><img src="../i/c.gif" width="1" height="1" alt=""/></td><td height="21" bgcolor="#000000" width="81" align="center"><a class="nav" style="color: #ffffff;" href="/cgi-bin/click.p?url=http://www.ibm.com/cn/services"><font size="2" color="#ffffff" face="宋体"><b>咨询</b></font></a></td><td bgcolor="#959595" width="1"><img src="../i/c.gif" width="1" height="1" alt=""/></td><td height="21" bgcolor="#000000" width="81" align="center"><a class="nav" style="color: #ffffff;" href="/cgi-bin/click.p?url=http://www.ibm.com/cn/industry"><font size="2" color="#ffffff" face="宋体"><b>行业</b></font></a></td><td bgcolor="#959595" width="1"><img src="../i/c.gif" width="1" height="1" alt=""/></td><td height="21" bgcolor="#000000" width="57" align="center"><a class="nav" style="color: #ffffff;" href="/cgi-bin/click.p?url=http://www.ibm.com/cn/news"><font size="2" color="#ffffff" face="宋体"><b>新闻</b></font></a></td><td bgcolor="#959595" width="1"><img src="../i/c.gif" width="1" height="1" alt=""/></td><td height="21" bgcolor="#000000" width="78" align="center"><a class="nav" style="color: #ffffff;" href="/cgi-bin/click.p?url=http://www.ibm.com/cn/ibm"><font size="2" color="#ffffff" face="宋体"><b>关于 IBM</b></font></a></td></tr></table></td></tr></table></td></tr></table><TABLE border="0" cellpadding="0" cellspacing="0" width="100%"><TR><TD width="150" height="1" bgcolor="#ffffff"><IMG alt="" height="1" width="150" src="../i/c.gif"></TD></TR><TR><TD width="150" height="3" bgcolor="#cc6633"><IMG alt="" height="3" width="150" src="../i/c.gif"></TD></TR><TR><TD width="150" height="1" bgcolor="#333333"><IMG alt="" height="1" width="150" src="../i/c.gif"></TD></TR><TR><TD width="150" height="1" bgcolor="#000000"><IMG alt="" height="1" width="150" src="../i/c.gif"></TD></TR></TABLE><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td><font face="Verdana, sans-serif" size="-1"><a href="/cgi-bin/click.p?url=http://www.ibm.com/cn">IBM</a> : <a
href="/developerWorks/">developerWorks 中国</a> : <a
href="/developerWorks/java/">Java</a> : <a
href="/developerWorks/education/java/">教学 - 在线课程</a></font><br x="7"><img src="imagemaster/masthead.jpg" alt="构建 Java 聊天服务器"></td><td width="*" valign="bottom" align="right"><a border="0" href="j-chat.zip"><img alt="下载教程 zip 文件" border="0" src="../i/icon-zip.gif"></a><a href=../tutorial_eng/index.html target=_blank><img alt="英文原文" border="0" src="../i/icon-source.gif"></a></td></tr><tr><td height="2" colspan="2"><img height="2" width="1" src="../i/c.gif"></td></tr></table><TABLE border="0" cellpadding="0" cellspacing="0" width="100%"><TR><TD width="150" height="1" bgcolor="#000000" colspan="6"><IMG alt="" height="1" width="150" src="../i/c.gif"></TD></TR><TR><TD background="../i/sw-gold.gif"><a border="0" href="index.html" onMouseOver="iOver('topmain'); iOver('bottommain'); self.status=mainblurb; return true;" onMouseOut="iOut('topmain'); iOut('bottommain'); self.status=''; return true;"><img alt="主菜单" border="0" src="../i/main.gif" name="topmain"></a></TD><TD background="../i/sw-gold.gif"><a border="0" onMouseOver="iOver('topsection'); iOver('bottomsection'); self.status=sectionblurb; return true;" onMouseOut="iOut('topsection'); iOut('bottomsection'); self.status=''; return true;" href="index4.html"><img alt="章节菜单" border="0" src="../i/section.gif" name="topsection"></a></TD><TD background="../i/sw-gold.gif"><a border="0" onMouseOver="iOver('topfeedback'); iOver('bottomfeedback'); self.status=feedbackblurb; return true;" onMouseOut="iOut('topfeedback'); iOut('bottomfeedback'); self.status=''; return true;" href="j-chat-11-3.html"><img alt="给出此教程的反馈意见" border="0" src="../i/feedback.gif" name="topfeedback"></a></TD><TD width="100%" background="../i/sw-gold.gif"><img src="../i/c.gif"></TD><TD background="../i/sw-gold.gif"><img border="0" src="../i/xprevious.gif"></TD><TD background="../i/sw-gold.gif"><a border="0" onMouseOver="iOver('topnext'); iOver('bottomnext'); self.status=nextblurb; return true;" onMouseOut="iOut('topnext'); iOut('bottomnext'); self.status=''; return true;" href="j-chat-4-2.html"><img alt="下一屏" border="0" src="../i/next.gif" name="topnext"></a></TD></TR></TABLE><table bgcolor="ffffff" cellspacing="0" cellpadding="2" border="0" height="400" width="100%"><tr valign="bottom"><a name="navskip"></a><td height="25" colspan="4"><img border="0" height="25" width="562" src="imagemaster/titlebar4.jpg" alt="4. While-Accept 循环(服务器方)"></td></tr><tr><td bgcolor="ffffff" width="15">&nbsp;</td><td bgcolor="ffffff" width="12">&nbsp;</td><td valign="top" align="left" bgcolor="ffffff" width="*"><p><br x="7"><table cellspacing="0" cellpadding="0" border="0"><tr><td width="90%"><font size="4" face="Verdana, Arial, Helvetica"><b>计划</b></font></td><td width="200" align="right"><font size="1" face="Verdana, Arial, Helvetica"><nobr>    第 1 页(共 4 页)</nobr></font></td></tr></table><br x="7"><br x="7"></p><font size="2" face="Verdana, Arial, Helvetica"><p>我们已经准备好开始接受来自客户机的网络连接。以下是聊天的工作原理。</p><p>我们在上面提到过,Java 语言提供一个名为 Socket 的对象,该对象代表至别处程序的连接,并且通过它传递数据。</p><p>但是首先如何获得这个套接字呢?客户机几乎在定义时就初始化了到服务器的连接。因此,服务器的第一项任务是等待连接进入。即,需要代码为我们提供与客户机连接的 Socket。</p><p>这就是 ServerSocket 的作用。它是一个对象,其任务很简单:在端口上侦听,并且当连接进入时,创建一个代表新连接的 Socket。</p><br x="7"></font></td></tr></table><TABLE border="0" cellpadding="0" cellspacing="0" width="100%"><TR><TD background="../i/sw-gold.gif"><a border="0" href="index.html" onMouseOver="iOver('topmain'); iOver('bottommain'); self.status=mainblurb; return true;" onMouseOut="iOut('topmain'); iOut('bottommain'); self.status=''; return true;"><img alt="主菜单" border="0" src="../i/main.gif" name="bottommain"></a></TD><TD background="../i/sw-gold.gif"><a border="0" onMouseOver="iOver('topsection'); iOver('bottomsection'); self.status=sectionblurb; return true;" onMouseOut="iOut('topsection'); iOut('bottomsection'); self.status=''; return true;" href="index4.html"><img alt="章节菜单" border="0" src="../i/section.gif" name="bottomsection"></a></TD><TD background="../i/sw-gold.gif"><a border="0" onMouseOver="iOver('topfeedback'); iOver('bottomfeedback'); self.status=feedbackblurb; return true;" onMouseOut="iOut('topfeedback'); iOut('bottomfeedback'); self.status=''; return true;" href="j-chat-11-3.html"><img alt="给出此教程的反馈意见" border="0" src="../i/feedback.gif" name="bottomfeedback"></a></TD><TD width="100%" background="../i/sw-gold.gif"><img src="../i/c.gif"></TD><TD background="../i/sw-gold.gif"><img border="0" src="../i/xprevious.gif"></TD><TD background="../i/sw-gold.gif"><a border="0" onMouseOver="iOver('topnext'); iOver('bottomnext'); self.status=nextblurb; return true;" onMouseOut="iOut('topnext'); iOut('bottomnext'); self.status=''; return true;" href="j-chat-4-2.html"><img alt="下一屏" border="0" src="../i/next.gif" name="bottomnext"></a></TD></TR><TR><TD width="150" height="1" bgcolor="#000000" colspan="6"><IMG alt="" height="1" width="150" src="../i/c.gif"></TD></TR></TABLE><TABLE cellpadding="0" cellspacing="0" border="0"><TR><TD width="182"><TABLE cellpadding="0" cellspacing="0" border="0" width="182"><TR bgcolor="#000000"><TD align="center" width="60" class="mast"><a style="text-decoration: none; color: #ffffff;" class="nav" href="http://www.ibm.com/privacy/"><font face="Arial, Verdana" size="2">隐私</font></a></TD><TD width="1" bgcolor="#959595"><img alt="" border="0" height="20" width="1" src="../i/c.gif"></TD><TD align="center" width="60" class="mast"><a style="text-decoration: none; color: #ffffff;" class="nav" href="http://www.ibm.com/legal/"><font face="Arial, Verdana" size="2">法律</font></a></TD><TD width="1" bgcolor="#959595"><img alt="" border="0" height="20" width="1" src="../i/c.gif"></TD><TD align="center" width="60" class="mast"><a style="text-decoration: none; color: #ffffff;" class="nav" href="http://www.ibm.com/contact/"><font face="Arial, Verdana" size="2">联系</font></a></TD><TD width="1" bgcolor="#959595"><img alt="" border="0" height="21" width="1" src="../i/c.gif"></TD></TR><TR bgcolor="#ffffff"><TD><img alt="" border="0" height="1" width="1" src="../i/c.gif"></TD></TR></TABLE></TD><TD width="100%"><TABLE cellpadding="0" cellspacing="0" border="0" width="100%"><TR height="21" bgcolor="#000000"><TD><img alt="" border="0" height="21" width="1" src="../i/c.gif"></TD></TR><TR bgcolor="#ffffff"><TD><img alt="" border="0" height="1" width="1" src="../i/c.gif"></TD></TR></TABLE></TD></TR></TABLE></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -