package cc;

public class Streamer extends Thread{
	boolean finish = false;
	boolean complete = false;

	public void stopStreaming () {
		finish = true;
		while(!complete);
	}

	public void completeStreaming () {
		if (finish) complete = true;
	}
}













/*

            long currentTime, initialTime= System.currentTimeMillis();

                currentTime = System.currentTimeMillis();
                if (currentTime - initialTime > 1000){
                    initialTime = currentTime;
                    this.pps = counter;
                    //System.out.print(counter);
                    counter = 0;
                }
                

    public static int howAreYou(float nominalMbps, int nominalSize){
        //System.out.println("nominalMbps: " + nominalMbps);
        //System.out.println("nominalSize: " + nominalSize);
        //System.out.println("PPS: " + pps);
                
        return (int)((float)(pps*nominalSize*8)/(10000*nominalMbps));
    }
    
    public  boolean verify(DatagramPacket pck){
        java.util.StringTokenizer st = new java.util.StringTokenizer( new String(pck.getData()), ";");
        //int packetPort   = (new Integer(st.nextToken())).intValue();
        int packetLabel  = (new Integer(st.nextToken())).intValue();
        //System.out.print(packetPort + ":" + packetLabel + " ");
        //System.out.print(".");
        
        if ((packetPort == port) && (packetLabel == label+1)){
            label = packetLabel;
            return true;
        }
        return false;
    }
    

*/
