@Override
	public void run() {
		while (true) {
			Packet packet = null;
			try {
				packet = queue.take();
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			
			if ( packet.isFormat() ) {
				while (queue.size() < 100 )
					try {
						Thread.sleep(1);
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
				
				format = packet;
				
				//for (int i=0; i<this.receivers.size(); i++)
				//	receivers.get(i).hasFormat = false;
			}
			
			for (int i=0; i<receivers.size(); i++) {
				if (!receivers.get(i).hasFormat)
					format.send(receivers.get(i), tsocket);
				
				if (!packet.isFormat())
					packet.send(receivers.get(i), tsocket);
			}
			
			try {
				Thread.sleep(1);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
		
		//tsocket.close();
	}