package org.kne.cloud.network.klalb;

import org.kne.cloud.network.NetworkPacket;
import org.kne.cloud.network.ipv6.IPv6Packet;

public class SendItem<T extends NetworkPacket> {

	private final long packetLength;
	private final T packet;
	private long sendtime=System.nanoTime();
	
	public SendItem(T packet) {
		this.packet=packet;
		this.packetLength=packet.getTotalLength();
	}

	public SendItem(T packet,int headerCalibrate) {
		this.packet=packet;
		this.packetLength=packet.getTotalLength()+headerCalibrate;
	}
	
	public T getPacket() {
		return packet;
	}

	public long getSendtime() {
		return sendtime;
	}

	public long getPacketLength() {
		return packetLength;
	}

	public void setSendtime(long sendtimex) {
		this.sendtime=sendtimex;
	}

	@Override
	public String toString() {
		return "SendItem [packetLength=" + packetLength + ", packet=" + packet + ", sendtime=" + sendtime + "]";
	}
	
}
