net.fs.rudp.message.PingMessage Java Examples

The following examples show how to use net.fs.rudp.message.PingMessage. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ClientControl.java    From NSS with Apache License 2.0 5 votes vote down vote up
public void sendPingMessage(){
int pingid=Math.abs(ran.nextInt());
long pingTime=System.currentTimeMillis();
pingTable.put(pingid, pingTime);
lastSendPingTime=System.currentTimeMillis();
PingMessage lm=new PingMessage(0,route.localclientId,pingid,Route.localDownloadSpeed,Route.localUploadSpeed);
lm.setDstAddress(dstIp);
lm.setDstPort(dstPort);
try {
	sendPacket(lm.getDatagramPacket());
} catch (IOException e) {
	//e.printStackTrace();
}
	}
 
Example #2
Source File: ClientControl.java    From finalspeed-91yun with GNU General Public License v2.0 5 votes vote down vote up
public void sendPingMessage(){
int pingid=Math.abs(ran.nextInt());
long pingTime=System.currentTimeMillis();
pingTable.put(pingid, pingTime);
lastSendPingTime=System.currentTimeMillis();
PingMessage lm=new PingMessage(0,route.localclientId,pingid,Route.localDownloadSpeed,Route.localUploadSpeed);
lm.setDstAddress(dstIp);
lm.setDstPort(dstPort);
try {
	sendPacket(lm.getDatagramPacket());
} catch (IOException e) {
	//e.printStackTrace();
}
	}
 
Example #3
Source File: ClientControl.java    From finalspeed with GNU General Public License v2.0 5 votes vote down vote up
public void sendPingMessage() {
    int pingid = Math.abs(ran.nextInt());
    long pingTime = System.currentTimeMillis();
    pingTable.put(pingid, pingTime);
    lastSendPingTime = System.currentTimeMillis();
    PingMessage lm = new PingMessage(0, route.localclientId, pingid, Route.localDownloadSpeed, Route
            .localUploadSpeed);
    lm.setDstAddress(dstIp);
    lm.setDstPort(dstPort);
    try {
        sendPacket(lm.getDatagramPacket());
    } catch (IOException e) {
        //e.printStackTrace();
    }
}
 
Example #4
Source File: ClientControl.java    From NSS with Apache License 2.0 4 votes vote down vote up
public void onReceivePing(PingMessage pm){
	if(route.mode==2){
		currentSpeed=pm.getDownloadSpeed()*1024;
		MLog.println("更新对方速度: "+currentSpeed);
	}
}
 
Example #5
Source File: ClientControl.java    From finalspeed-91yun with GNU General Public License v2.0 4 votes vote down vote up
public void onReceivePing(PingMessage pm){
	if(route.mode==2){
		currentSpeed=pm.getDownloadSpeed()*1024;
		//#MLog.println("更新对方速度: "+currentSpeed);
	}
}
 
Example #6
Source File: ClientControl.java    From finalspeed with GNU General Public License v2.0 4 votes vote down vote up
public void onReceivePing(PingMessage pm) {
    if (route.mode == 2) {
        currentSpeed = pm.getDownloadSpeed() * 1024;
        //#MLog.println("更新对方速度: "+currentSpeed);
    }
}