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;
import java.util.Vector;

public abstract class KLALBPacket implements Sumable{
	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;
	public static final int ADDLINES=9;
	public static final int NACKT=10;
	public static final int TEST=11;
	public static final int VADDRACK=12;
	public static final int VADDRREQ=13;
	private int type;

	public KLALBPacket(int type) {
		super();
		this.type = type;
	}
	@Override
	public String toString() {
		return "KLALBPacket [type=" + type + "]";
	}
	public int getType() {
		return type;
	}
	
	private long sndtime,rcvtime;
	protected void writeToStream(DataOutput dto) throws IOException {
		sndtime=System.nanoTime();
	}
	protected void readFromStream(DataInput din) throws IOException {
		rcvtime=System.nanoTime();
	}
	public long getSndtime() {
		return sndtime;
	}
	public long getRcvtime() {
		return rcvtime;
	}
	public long getLength() {
		return 1;
	}
	@Override
	public long getValue() {
		return getLength();
	}

	
	private Vector<KLALBRemoteLine> sendRecord=new Vector<>();

	public Vector<KLALBRemoteLine> getSendRecord() {
		return sendRecord;
	}

	
}
