public synchronized MessageBlock checkForMissingBlocks(final int size, final long time) {
		for (MessageBlockDef mbd : repeatBlocks) {
			if (size < mbd.length) {
				repeatBlocks.remove(mbd);
				sentBlocks.add(new MessageBlockDef(mbd.offset, size));
				repeatBlocks.add(new MessageBlockDef(mbd.offset + size, mbd.length - size, mbd.timeSent));
				return sendBlock(mbd.offset, size);

			} else {
				sentBlocks.add(new MessageBlockDef(mbd.offset, mbd.length));
				repeatBlocks.remove(mbd);

				return sendBlock(mbd.offset, mbd.length);
			}
		}

		for (MessageBlockDef mbd : sentBlocks) {
			if (mbd.timeSent + time < System.currentTimeMillis()) {
				sentBlocks.remove(mbd);

				if (size < mbd.length) {
					sentBlocks.add(new MessageBlockDef(mbd.offset, size));
					sentBlocks.add(new MessageBlockDef(mbd.offset + size, mbd.length - size, mbd.timeSent));
					return sendBlock(mbd.offset, size);

				} else {
					sentBlocks.add(new MessageBlockDef(mbd.offset, mbd.length));

					return sendBlock(mbd.offset, mbd.length);
				}
			}
		}

		return null;
	}