go-back-njava程序,真正的好东西

go-back-njava程序,真正的好东西

ID:31643337

大小:105.89 KB

页数:30页

时间:2019-01-16

go-back-njava程序,真正的好东西_第1页
go-back-njava程序,真正的好东西_第2页
go-back-njava程序,真正的好东西_第3页
go-back-njava程序,真正的好东西_第4页
go-back-njava程序,真正的好东西_第5页
资源描述:

《go-back-njava程序,真正的好东西》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库

1、国外教材《计算机网络》Go-Back-NJava程序,形象生动,学习效果很好。/**ThisGoBackNAppletwasdesignedtobeusedinconjunctionwith*nComputerNetworking:ATopDownApproach!r*byJamesKurose&KeithRoss.*Terminologyandspecificationsarcbasedupontheirdcscriptionofthe*GoBackNprotocolinchapter3,section4.**OriginalApplet

2、codedbyShamiulAzomasprojectassignedby*Prof.MartinReisslein,ArizoriaStateUniversity*CourseNo.EEE-459/591・Spring2001**AppletsignificantlyrevisedbyMatthewShatleyandChrisHoffman*forProfessorPaulD・Amer(amer@udel.edu)*UniversityofDelaware(2008)**AppletupdatedFeb.2012byChrisHoffm

3、antofixGoBackNtextoutput*toreflectthesingletimerimplementationofGoBackN,asoutlined*onpg234inthe5theditionoftheaforementionedtext.**Anoteonmagicnumbers:Magicnumbersarehorribletohaveinyourcodeingeneral.*However,thegraphicscomponentsofthisappletprovidednogoodwaytoremovethe*ma

4、gicnumbersfromthecodeaslocationsforobjectsarespecifiedinpixelcoordinates.*Weapologizeinadvanceforanyconfusionthismaycauseinreadingthecode.*/importjava.applet.Applet;importjava.awt.*;importjava.awt.event.ActionListener;importjava.awt.event.ActionEvent;publicclassGBNextendsA

5、ppletimplementsActionListener,Runnable{privatestaticfinalintADVANCEPACKET二5;//Defaultvaluesofparametersforanimation//scndcr_window_lcn_dcfthesendercanhaveamaximumof5outstanding//un-acknowledgedpacketsfinalintsender_window_len_def=5;//howmanypacketsthereceivercanholdinmemor

6、ywithoutdeliveringdata//inthecaseofGBNwecanhold1(orthecurrentpacket)inmemory//ifanotherpacketarrivestheoneinmemoryisdiscardedfinalintreceiverwindowlen二1;//GUTcomponentstodescribehowtheSimulationshouldbedrawnfinalintfinalintfinalmtfinalmtfinalintpack_width_dcf二10;pack_heigh

7、t_def=30;h_offset_def=100;voffsetdef二50;v_clearance_def=300;//usedfortimeoutvalues,thread,sleep()isspecifiedinmilliseconds//soweconverttosecondsfortimeoutprocessing.(1000milliseconds=1second)finalintTIMEOUT_MULTIPLIER二1000;finalintM1N_FPS=3;finalintFPS_STEP=2;finalintDESEL

8、ECTED二-1;finalintDEFAULT_FPS=5;//defauItto20packetsifnovalueissuppliedfinalinttotal_packe

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。