forked from KNEMC/KLALB
KLALB完全大重写,代码规范了,可以当作网络库使用
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
package org.kne.cloud.network.klalb;
|
||||
|
||||
import java.io.DataInput;
|
||||
import java.io.DataOutput;
|
||||
import java.io.Externalizable;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInput;
|
||||
import java.io.ObjectOutput;
|
||||
|
||||
public abstract class KLALBPacket{
|
||||
public static final int PING=0;
|
||||
public static final int PONG=1;
|
||||
public static final int SYNT=2;
|
||||
public static final int SACKT=3;
|
||||
public static final int RST=4;
|
||||
public static final int DATAT=5;
|
||||
public static final int ACKT=6;
|
||||
public static final int DATAU=7;
|
||||
public static final int VADDR=8;
|
||||
|
||||
private int type;
|
||||
|
||||
public KLALBPacket() {
|
||||
super();
|
||||
}
|
||||
public KLALBPacket(int type) {
|
||||
super();
|
||||
this.type = type;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "KLALBPacket [type=" + type + "]";
|
||||
}
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
protected void writeToStream(DataOutput dto) throws IOException {
|
||||
|
||||
}
|
||||
protected void readFromStream(DataInput din) throws IOException {
|
||||
|
||||
}
|
||||
public long getLength() {
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user