package cz.vutbr.feec.session.gnp;

import org.apache.log4j.Logger;

import cz.vutbr.feec.packets.ttp.LMVPacket;

public class ThreadInMulticast extends ThreadIn {
	private static Logger logger = Logger.getLogger(ThreadInMulticast.class
			.getName());

	public ThreadInMulticast() {
		setName("TTP-FT(in Multicast)");
	}

	@Override
	public void run() {
		logger.debug("STARTED");
		while (true) {
			try {
				// receive
				sleep(1000);
				LMVPacket p = new LMVPacket();
				getSession().received(p);
				logger.debug("Received packet" + p);
			} catch (InterruptedException e) {
			}

			if (isStopped())
				break;
		}
		logger.debug("FINISHED");
	}
}
