Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3308/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.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Application.java 19 Nov 2005 11:18:57 -0000 1.1
--- Application.java 19 Nov 2005 11:46:08 -0000 1.2
***************
*** 17,21 ****
--- 17,28 ----
protected String protocolName;
protected int listenPort;
+ protected int clientPort;
private ProtocolStack mParentStack;
+
+ protected String sdHost;
+ protected int sdPort;
+
+ private int id;
+ static int count;
/** Creates a new instance of ApplicationProtocol */
***************
*** 23,26 ****
--- 30,35 ----
this.listenPort = listenPort;
this.mParentStack = inParentStack;
+ count++;
+ this.id = count;
}
***************
*** 31,35 ****
*/
public void Listen() throws TransportLayerException{
! //throw new TransportLayerException("Cannot bind port " + listenPort + ".");
}
--- 40,44 ----
*/
public void Listen() throws TransportLayerException{
! //throw new TransportLayerException("Cannot bind port " + listenPort + ".");
}
Index: Echo.java
===================================================================
RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Echo.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Echo.java 19 Nov 2005 11:18:57 -0000 1.1
--- Echo.java 19 Nov 2005 11:46:08 -0000 1.2
***************
*** 28,32 ****
public void Listen() throws TransportLayerException{
//throw new TransportLayerException("Cannot bind port " + listenPort + ".");
! //mParentStack.
}
--- 28,32 ----
public void Listen() throws TransportLayerException{
//throw new TransportLayerException("Cannot bind port " + listenPort + ".");
! mParentStack.ListenUDP(this, listenPort);
}
***************
*** 38,42 ****
* @version v0.01
*/
! public void Close(){}
/**
--- 38,44 ----
* @version v0.01
*/
! public void Close(){
! mParentStack.CloseUDP(this, listenPort);
! }
/**
***************
*** 48,52 ****
*/
! public void Connect(String Host, int port) throws TransportLayerException {}
/**
--- 50,58 ----
*/
! public void Connect(String Host, int port) throws TransportLayerException {
! sdHost = Host;
! sdPort = port;
! clientPort = mParentStack.reserveUDPPort(this, sdHost, sdPort);
! }
/**
***************
*** 56,60 ****
*/
! public void Disconnect(){}
/**
--- 62,68 ----
*/
! public void Disconnect(){
! mParentStack.freeUDPPort(this);
! }
/**
***************
*** 65,69 ****
*/
! public void SendData(String Data) throws TransportLayerException {}
/**
--- 73,80 ----
*/
! public void SendData(String Data) throws TransportLayerException {
! mParentStack.sendUDP(Data, this, clientPort);
! //processing the protocol doings.
! }
/**
***************
*** 73,76 ****
* @version v0.01
*/
! public void RecvData(String Data) throws TransportLayerException {}
}
--- 84,89 ----
* @version v0.01
*/
! public void RecvData(String Data) throws TransportLayerException {
! //processing the protocol doings.
! }
}
|