KLALB大更新
新负载均衡算法
This commit is contained in:
@@ -1,13 +1,41 @@
|
||||
package org.kne.cloud.network.klalb;
|
||||
|
||||
import java.io.DataInput;
|
||||
import java.io.DataOutput;
|
||||
import java.io.IOException;
|
||||
|
||||
public class PINGPacket extends KLALBPacket {
|
||||
|
||||
|
||||
private long time;
|
||||
|
||||
@Override
|
||||
protected void writeToStream(DataOutput dto) throws IOException {
|
||||
super.writeToStream(dto);
|
||||
dto.writeLong(time);
|
||||
}
|
||||
|
||||
public long getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readFromStream(DataInput din) throws IOException {
|
||||
super.readFromStream(din);
|
||||
time=din.readLong();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getLength() {
|
||||
return super.getLength()+8;
|
||||
}
|
||||
|
||||
public PINGPacket() {
|
||||
super(PING);
|
||||
}
|
||||
|
||||
public PINGPacket(long time) {
|
||||
super(PING);
|
||||
this.time=time;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PING";
|
||||
|
||||
Reference in New Issue
Block a user