[Javanetsim-cvs] javaNetSim/core/protocolsuite/tcp_ip Echo.java, 1.20, 1.21 Echo_tcp.java, 1.28, 1.
Status: Beta
Brought to you by:
darkkey
From: Alexander B. <da...@us...> - 2006-09-09 13:44:05
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv20741/core/protocolsuite/tcp_ip Modified Files: Echo.java Echo_tcp.java Log Message: Index: Echo_tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Echo_tcp.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** Echo_tcp.java 3 Sep 2006 14:32:08 -0000 1.28 --- Echo_tcp.java 9 Sep 2006 13:43:58 -0000 1.29 *************** *** 36,39 **** --- 36,40 ---- private long utc1; + public int recieved; /** Creates a new instance of Echo */ *************** *** 50,53 **** --- 51,55 ---- public void Listen() throws TransportLayerException{ //throw new TransportLayerException("Cannot bind port " + listenPort + "."); + recieved = 0; try{ if(appType != 0) mParentStack.ListenTCP(this, listenPort); *************** *** 68,71 **** --- 70,74 ---- { mParentStack.FreeTCPApplication(this); + recieved = 0; } *************** *** 174,177 **** --- 177,182 ---- public void RecvData(String Data) throws LowLinkException, TransportLayerException { //processing the protocol doings. + recieved++; + if(appType == 0){ //client processing recieve *************** *** 200,204 **** protInfo2.setDataType("Echo Protocol Data"); protInfo2.setLayer("Application "); ! protInfo2.setDescription("Connection time: " + (long)(System.currentTimeMillis () - utc1) + " ms."); Simulation.addLayerInfo(protInfo2); }else{ --- 205,209 ---- protInfo2.setDataType("Echo Protocol Data"); protInfo2.setLayer("Application "); ! protInfo2.setDescription("Connection time: " + (long)(System.currentTimeMillis () - utc1) + " ms. Total recieved messages: " + recieved + "."); Simulation.addLayerInfo(protInfo2); }else{ *************** *** 226,230 **** protInfo.setDataType("Echo Protocol Data"); protInfo.setLayer("Application "); ! protInfo.setDescription("Recieving echo message '" + Data + "' from client."); Simulation.addLayerInfo(protInfo); --- 231,235 ---- protInfo.setDataType("Echo Protocol Data"); protInfo.setLayer("Application "); ! protInfo.setDescription("Recieving echo message '" + Data + "' from client. Total recieved messages: " + recieved + "."); Simulation.addLayerInfo(protInfo); *************** *** 258,261 **** --- 263,267 ---- mParentStack.FreeTCPApplication(this); + recieved = 0; this.counts = counts; Index: Echo.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Echo.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Echo.java 28 Feb 2006 18:14:22 -0000 1.20 --- Echo.java 9 Sep 2006 13:43:58 -0000 1.21 *************** *** 29,32 **** --- 29,33 ---- long utc1; + public int recieved; /** Creates a new instance of Echo */ *************** *** 131,134 **** --- 132,136 ---- */ public void RecvData(String Data) throws LowLinkException, TransportLayerException { + recieved++; //processing the protocol doings. if(appType == 0){ *************** *** 157,161 **** protInfo.setDataType("Echo Protocol Data"); protInfo.setLayer("Application "); ! protInfo.setDescription("Recieving echo message '" + Data + "' from client."); Simulation.addLayerInfo(protInfo); --- 159,163 ---- protInfo.setDataType("Echo Protocol Data"); protInfo.setLayer("Application "); ! protInfo.setDescription("Recieving echo message '" + Data + "' from client. Total recieved messages: " + recieved); Simulation.addLayerInfo(protInfo); *************** *** 196,199 **** --- 198,202 ---- utc1 = System.currentTimeMillis () ; + recieved = 0; for(int c=0; c<counts; c++){ *************** *** 223,227 **** protInfo2.setDataType("Echo Protocol Data"); protInfo2.setLayer("Application "); ! protInfo2.setDescription("Connection time: " + (long)(System.currentTimeMillis () - utc1) + " ms."); Simulation.addLayerInfo(protInfo2); } --- 226,230 ---- protInfo2.setDataType("Echo Protocol Data"); protInfo2.setLayer("Application "); ! protInfo2.setDescription("Connection time: " + (long)(System.currentTimeMillis () - utc1) + " ms. Sent messages: " + counts + " Recieved messages: " + recieved); Simulation.addLayerInfo(protInfo2); } |