[Javanetsim-cvs] javaNetSim/core/protocolsuite/tcp_ip Echo.java,1.7,1.8 Udp.java,1.13,1.14
Status: Beta
Brought to you by:
darkkey
From: Alexander B. <da...@us...> - 2005-11-20 14:22:07
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5202/core/protocolsuite/tcp_ip Modified Files: Echo.java Udp.java Log Message: Index: Udp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Udp.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Udp.java 20 Nov 2005 14:07:13 -0000 1.13 --- Udp.java 20 Nov 2005 14:21:58 -0000 1.14 *************** *** 394,398 **** --- 394,409 ---- Elm.connectedtoIP=inDestIPAddress; Elm.connectedtoPort=indestPort; + /*<<<<<<< Udp.java + Elm.application = application; //GIFT: UGLY BUG!!!! + //PortTable.remove(new Integer(number+PORT_START_NUMBER)); //delete old element + //PortTable.put(new Integer(number+PORT_START_NUMBER),Elm); //hash table update + try{ + UDP_HashTableElement Elm1 = null; + Elm1 = (UDP_HashTableElement) PortTable.get(new Integer(number+PORT_START_NUMBER)); + System.out.println(Elm1.PortStatus); + }catch(Exception e){System.out.println("!!!");} + =======*/ Elm.application = application; + //>>>>>>> 1.9 } if (!Reserved) number++; *************** *** 516,521 **** UDP_HashTableElement Elm = null; ! if ( (Elm =(UDP_HashTableElement)PortTable.get(inPort)) !=null ) ! { switch(Elm.PortStatus) { --- 527,533 ---- UDP_HashTableElement Elm = null; ! if ( ((UDP_HashTableElement)PortTable.get(inPort)) !=null ) ! { ! Elm =(UDP_HashTableElement)PortTable.get(inPort); switch(Elm.PortStatus) { *************** *** 557,561 **** newElm.connectedtoPort=0; ! PortTable.put(inPort,Elm); //hash table update } } else throw new TransportLayerException("UDP Error: can not listen to port "+ inPort +"! Use port range from 0 to 10000 to listen to."); --- 569,573 ---- newElm.connectedtoPort=0; ! PortTable.put(inPort,newElm); //hash table update } } else throw new TransportLayerException("UDP Error: can not listen to port "+ inPort +"! Use port range from 0 to 10000 to listen to."); *************** *** 574,578 **** public String getApplicationDestIP(int inSrcPort) throws TransportLayerException { ! String dIP=null; UDP_HashTableElement Elm = null; --- 586,605 ---- public String getApplicationDestIP(int inSrcPort) throws TransportLayerException { ! String dIP=null;/* ! <<<<<<< Udp.java ! boolean Found=false; ! Set set = PortTable.keySet(); ! Iterator itr = set.iterator(); ! ! UDP_HashTableElement ElmDBG = (UDP_HashTableElement)PortTable.get(new Integer(3000)); ! ! System.out.println(ElmDBG.PortStatus); ! Enumeration keys = PortTable.elements(); ! ! //Integer key = Integer.valueOf(keys.nextElement()); ! ! //System.out.println(key); ! ======= ! >>>>>>> 1.12*/ UDP_HashTableElement Elm = null; Index: Echo.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Echo.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Echo.java 19 Nov 2005 21:53:51 -0000 1.7 --- Echo.java 20 Nov 2005 14:21:58 -0000 1.8 *************** *** 113,120 **** --- 113,122 ---- //client processing recieve // printing some ... + System.out.println(Data); Disconnect(); }else{ //server processing recieve try{ + System.out.println(Data); SendData(Data); Close(); *************** *** 136,139 **** --- 138,142 ---- public void SendEcho(String Data, String Host, int port) throws CommunicationException, LowLinkException, InvalidNetworkLayerDeviceException, TransportLayerException{ ClientConnect(Host, port); + SendData(Data); } |