Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2162/core/protocolsuite/tcp_ip
Modified Files:
Echo.java
Log Message:
Corrected LayerInfo for Echo
Index: Echo.java
===================================================================
RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Echo.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** Echo.java 20 Nov 2005 14:21:58 -0000 1.8
--- Echo.java 20 Nov 2005 16:36:59 -0000 1.9
***************
*** 16,19 ****
--- 16,24 ----
import core.LowLinkException;
+ import core.LayerInfo;
+
+ import core.Packet;
+
+ import core.Simulation;
/**
***************
*** 113,123 ****
//client processing recieve
// printing some ...
! System.out.println(Data);
Disconnect();
}else{
//server processing recieve
try{
! System.out.println(Data);
SendData(Data);
Close();
Listen();
--- 118,161 ----
//client processing recieve
// printing some ...
! LayerInfo protInfo = new LayerInfo(getClass().getName());
! protInfo.setObjectName(mParentStack.getParentNodeName());
! protInfo.setDataType("Echo Protocol Data");
! protInfo.setLayer("Application ");
! protInfo.setDescription("Recieving echo message '" + Data + "' from server.");
! Simulation.addLayerInfo(protInfo);
! /*
! LayerInfo protInfo = new LayerInfo(getClass().getName());
! protInfo.setObjectName(mParentStack.getParentNodeName());
! protInfo.setDataType("Echo Protocol Data");
! protInfo.setLayer("Application ");
! protInfo.setDescription("Recieving echo message '" + Data + "' from server.");
! Simulation.addLayerInfo(protInfo);*/
Disconnect();
}else{
//server processing recieve
try{
! LayerInfo protInfo = new LayerInfo(getClass().getName());
! protInfo.setObjectName(mParentStack.getParentNodeName());
! protInfo.setDataType("Echo Protocol Data");
! protInfo.setLayer("Application ");
! protInfo.setDescription("Recieving echo message '" + Data + "' from client.");
! Simulation.addLayerInfo(protInfo);
!
! LayerInfo protInfo2 = new LayerInfo(getClass().getName());
! protInfo2.setObjectName(mParentStack.getParentNodeName());
! protInfo2.setDataType("Echo Protocol Data");
! protInfo2.setLayer("Application ");
! protInfo2.setDescription("Sending echo message '" + Data + "' to client.");
! Simulation.addLayerInfo(protInfo2);
!
SendData(Data);
+
+ LayerInfo protInfo3 = new LayerInfo(getClass().getName());
+ protInfo3.setObjectName(mParentStack.getParentNodeName());
+ protInfo3.setDataType("Echo Protocol Data");
+ protInfo3.setLayer("Application ");
+ protInfo3.setDescription("Server closing connection. Now listening on " + listenPort + ".");
+ Simulation.addLayerInfo(protInfo3);
+
Close();
Listen();
***************
*** 139,142 ****
--- 177,187 ----
ClientConnect(Host, port);
+ LayerInfo protInfo = new LayerInfo(getClass().getName());
+ protInfo.setObjectName(mParentStack.getParentNodeName());
+ protInfo.setDataType("Echo Protocol Data");
+ protInfo.setLayer("Application ");
+ protInfo.setDescription("Start sending echo message '" + Data + "' to " + Host + ":" + port);
+ Simulation.addLayerInfo(protInfo);
+
SendData(Data);
}
|