📄 guitestbroadcastrreq.java
字号:
package aodvgui2;
import qosaodv.*;
import qosaodv.itface.*;
import qosaodv.conf.*;
import qosaodv.other.*;
import qosaodv.minders.*;
import qosaodv.msg.*;
import qosaodv.net.*;
import javax.microedition.midlet.*;
import javax.microedition.io.*;
import javax.microedition.lcdui.*;
import java.io.*;
public class GuiTestBroadcastRREQ //extends Thread
{
public RouteManager rtMgr;
RREQ rreq;
DatagramConnection conn;
Datagram dgram = null;
boolean mf ;
byte ttl ;
boolean jf ;
boolean rf ;
boolean gf;
boolean df ;
boolean usnf ;
byte hc ;
int ri ;
int dsn ;
int osn ;
InetAddress sendto ;
InetAddress da ;
InetAddress oa;
GuiTestBroadcastRREQ(AodvGuiMIDlet midlet)
{
rtMgr = midlet.qaodv.rtMgr;
mf = false;
ttl = 10;
jf = true;
rf = true;
gf = true;
df = true;
usnf =true;
hc = 0;
ri =10;
dsn =11;
osn =3;
sendto = InetAddress.getByAddress("255.255.255.255");
da = InetAddress.getByAddress("192.168.0.2");
oa = midlet.qaodv.cfgInfo.ipAddressVal;
try{
rreq = new RREQ(rtMgr.cfgInfo, rtMgr.curInfo, mf, sendto, ttl, jf, rf, gf, df, usnf, hc, ri, da , dsn, oa, osn);
}catch(Exception ex){
System.out.println("error!!!");
}
}
/* public void run()
{
try{
if(rtMgr.rtList.getRouteCount() >0)
{
System.out.println("There are " + rtMgr.rtList.getRouteCount() + " RouteEntry in RouteList~~~~~~:");
RouteEntry array[] = rtMgr.rtList.getRouteArray();
for(int i = 0; i < rtMgr.rtList.getRouteCount(); i++)
System.out.println( array[i].toString() );
}
// System.out.println("nothing");
}catch(IOException ioe){
System.out.println(ioe.getMessage());
ioe.printStackTrace();
}catch(Exception ex){
System.out.println("RouteList Error");
}
}
*/
public void routeList()
{
try{
if(rtMgr.rtList.getRouteCount() >0)
{
System.out.println("There are " + rtMgr.rtList.getRouteCount() + " RouteEntry in RouteList~~~~~~:");
RouteEntry array[] = rtMgr.rtList.getRouteArray();
for(int i = 0; i < rtMgr.rtList.getRouteCount(); i++)
System.out.println( array[i].toString() );
}
else System.out.println("No route in RouteList!");
}catch(IOException ioe){
System.out.println(ioe.getMessage());
ioe.printStackTrace();
}catch(Exception ex){
System.out.println("RouteList Error");
}
}
public void sendRREQ()
{
try{
rtMgr. pktSender.sendMessage(rreq);
}catch(IOException ioe){
System.out.println(ioe.getMessage());
ioe.printStackTrace();
System.out.println("Send RREQ Error");
}
}
/* public void terminate()
{
interrupt();
}*/
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -