Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7620/core/protocolsuite/tcp_ip
Modified Files:
Application.java Echo.java
Log Message:
Index: Application.java
===================================================================
RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Application.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Application.java 19 Nov 2005 13:07:37 -0000 1.4
--- Application.java 19 Nov 2005 14:26:02 -0000 1.5
***************
*** 24,36 ****
protected int appType;
! private int id;
! static int count;
!
/** Creates a new instance of ApplicationProtocol */
! public Application(ProtocolStack inParentStack, int listenPort, int appType){
this.listenPort = listenPort;
this.mParentStack = inParentStack;
- count++;
- this.id = count;
}
--- 24,32 ----
protected int appType;
! protected int UID;
/** Creates a new instance of ApplicationProtocol */
! public Application(ProtocolStack inParentStack, int listenPort, int appType, int UID){
this.listenPort = listenPort;
this.mParentStack = inParentStack;
}
***************
*** 95,97 ****
--- 91,97 ----
return this.listenPort;
}
+
+ public int getUID(){
+ return this.UID;
+ }
}
Index: Echo.java
===================================================================
RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Echo.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Echo.java 19 Nov 2005 13:07:37 -0000 1.4
--- Echo.java 19 Nov 2005 14:26:02 -0000 1.5
***************
*** 17,22 ****
/** Creates a new instance of Echo */
! public Echo(ProtocolStack inParentStack, int listenPort, int appType) {
! super(inParentStack, listenPort, appType);
}
--- 17,22 ----
/** Creates a new instance of Echo */
! public Echo(ProtocolStack inParentStack, int listenPort, int appType, int UID) {
! super(inParentStack, listenPort, appType, UID);
}
***************
*** 28,32 ****
public void Listen() throws TransportLayerException{
//throw new TransportLayerException("Cannot bind port " + listenPort + ".");
! mParentStack.ListenUDP(this, listenPort);
}
--- 28,32 ----
public void Listen() throws TransportLayerException{
//throw new TransportLayerException("Cannot bind port " + listenPort + ".");
! //mParentStack.ListenUDP(this, listenPort);
}
***************
*** 39,43 ****
*/
public void Close(){
! mParentStack.CloseUDP(this, listenPort);
}
--- 39,43 ----
*/
public void Close(){
! //mParentStack.CloseUDP(this);
}
***************
*** 53,57 ****
sdHost = Host;
sdPort = port;
! clientPort = mParentStack.reserveUDPPort(this, sdHost, sdPort);
}
--- 53,57 ----
sdHost = Host;
sdPort = port;
! //clientPort = mParentStack.reserveUDPPort(this, sdHost, sdPort);
}
***************
*** 74,78 ****
public void Disconnect(){
! mParentStack.freeUDPPort(this);
}
--- 74,78 ----
public void Disconnect(){
! //mParentStack.freeUDPPort(this);
}
***************
*** 85,92 ****
public void SendData(String Data) throws TransportLayerException {
! mParentStack.sendUDP(Data, this);
//processing the protocol doings.
}
/**
* This method recieves data from the other side.
--- 85,94 ----
public void SendData(String Data) throws TransportLayerException {
! //mParentStack.sendUDP(this, Data);
//processing the protocol doings.
}
+
+
/**
* This method recieves data from the other side.
|