Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30654/core/protocolsuite/tcp_ip
Modified Files:
Echo_tcp.java ProtocolStack.java
Log Message:
Transport counters + minor ARP counters fix.
Index: ProtocolStack.java
===================================================================
RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ProtocolStack.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** ProtocolStack.java 8 Dec 2005 16:45:10 -0000 1.33
--- ProtocolStack.java 8 Dec 2005 19:04:23 -0000 1.34
***************
*** 1304,1314 ****
public int getARPCount(){
! return packetoutputIPCounter;
}
public void resetCounters(){
packetinputIPCounter = 0;
packetoutputIPCounter = 0;
packetARPCounter = 0;
}
--- 1304,1333 ----
public int getARPCount(){
! return packetARPCounter;
! }
!
! public int getTCPinputCount(){
! return mTCPprotocol.GetReceivedSegmentsNumber();
}
+ public int getTCPoutputCount(){
+ return mTCPprotocol.GetSentSegmentsNumber();
+ }
+
+ public int getUDPinputCount(){
+ return mUDPprotocol.GetReceivedDatagrammsNumber();
+ }
+
+ public int getUDPoutputCount(){
+ return mUDPprotocol.GetSentDatagrammsNumber();
+ }
+
+
public void resetCounters(){
packetinputIPCounter = 0;
packetoutputIPCounter = 0;
packetARPCounter = 0;
+ mUDPprotocol.ResetCounters();
+ mTCPprotocol.ResetCounters();
}
Index: Echo_tcp.java
===================================================================
RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Echo_tcp.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** Echo_tcp.java 4 Dec 2005 22:14:21 -0000 1.15
--- Echo_tcp.java 8 Dec 2005 19:04:23 -0000 1.16
***************
*** 30,37 ****
--- 30,39 ----
private byte ConnectionAttempts=5;
+ private int tryings;
/** Creates a new instance of Echo */
public Echo_tcp(ProtocolStack inParentStack, int listenPort, int appType, int UID) {
super(inParentStack, listenPort, appType, UID);
+ tryings = 0;
}
***************
*** 210,213 ****
--- 212,217 ----
mParentStack.FreeTCPApplication(this);
+
+
if (ClientConnect(Host, port))
{
***************
*** 221,225 ****
SendData(Data);
- //SendData("CLIENTTTTT-Botva");
} else
{
--- 225,228 ----
***************
*** 230,233 ****
--- 233,237 ----
protInfo.setDescription("Error: can not connect to " + Host + ":" + port + "!");
Simulation.addLayerInfo(protInfo);
+
}
}
|