@Override
	public void run() {
		System.out.println(this.hostName + " Online.");
		Packet pkt;
		CommandWrapper cmdw;
		final Guard[] guard = { consoleIn, in };
		final Alternative alt = new Alternative(guard);

		while (true) {
			switch (alt.fairSelect()) {
			// 0 Corresponde ao canal "consoleIn"
			case 0:
				cmdw = (CommandWrapper) consoleIn.read();
				runConsoleCommand(cmdw);
				break;
			// 1 Corresponde ao canal "in"
			case 1:
				pkt = (Packet) this.in.read();
				if (checkPkt(pkt)){
					buffer.add(pkt);
					if(pkt.lastFragment){
						String buffData = this.mergePacketBuffer(pkt.sizeFinal);
						pkt.data = buffData;
						printPkt(pkt);
					}
				}
				break;
			}
		}
	}