[Javanetsim-cvs] javaNetSim/core EthernetLink.java,1.12,1.13
Status: Beta
Brought to you by:
darkkey
From: QweR <qw...@us...> - 2007-11-11 19:52:03
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv19828/core Modified Files: EthernetLink.java Log Message: TCP bugs fixed Index: EthernetLink.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/EthernetLink.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** EthernetLink.java 10 Nov 2006 08:32:22 -0000 1.12 --- EthernetLink.java 11 Nov 2007 19:51:57 -0000 1.13 *************** *** 41,45 **** public class EthernetLink extends Link { ! /** * Constructor to be used by the Simulation when connecting 2 PC's --- 41,45 ---- public class EthernetLink extends Link { ! java.security.SecureRandom rng; /** * Constructor to be used by the Simulation when connecting 2 PC's *************** *** 58,62 **** NetworkInterfaces.add(inSecondNodeInterface); inFirstNodeInterface.setConnectedLink(this); ! inSecondNodeInterface.setConnectedLink(this); } --- 58,63 ---- NetworkInterfaces.add(inSecondNodeInterface); inFirstNodeInterface.setConnectedLink(this); ! inSecondNodeInterface.setConnectedLink(this); ! rng = new java.security.SecureRandom(); } *************** *** 68,71 **** --- 69,73 ---- inSecondNodeInterface.setConnectedLink(this); this.setSC(sieveCoeff); + rng = new java.security.SecureRandom(); } *************** *** 86,90 **** if (!temp.getSourceName().equals(inSourceName)) { ! if( ((sievingCoefficient)/100)>Math.random()) temp.receivePacket(inPacket); else{ --- 88,93 ---- if (!temp.getSourceName().equals(inSourceName)) { ! //if( ((sievingCoefficient)/100)>Math.random()) ! if((sievingCoefficient)>rng.nextInt(100)) temp.receivePacket(inPacket); else{ |