@Override
	protected void onStarted() {
		GlobalUtil.threadExecutor().execute(new Runnable() {
			@Override
			public void run() {
				FileReceivingController receiver;
				int percent;
				int speed;
				while (isRunning()) {
					for (CoreFileInfo file : receivingFiles.keySet()) {
						if (file != null) {
							receiver = receivingFiles.get(file);
							if (receiver != null) {
								if (receiver.getReceivedLength() < file.length) {
									percent = (int) (receiver.getReceivedLength() * 100 / file.length);
									speed = (int) (receiver.getReceivedLength() / (System.currentTimeMillis() - receiver.getStartReceivingTime()));
									if(GlobalUtil.SHOW_SYSTEM_OUT)
										System.out.println("Receiving file " + file.pathName + " with " + speed + " KB/s.");
									onReceivingFile(file, percent, speed);
								} else {
									receivingFiles.put(file, null);
								}
							}
						}
					}
					try {
						Thread.sleep(1000);
					} catch (Exception e) {
						e.printStackTrace(System.err);
					}
				}
				receivingFiles.clear();
			}
		});
	}