@Override
		public void run() {
			
			try {
				while(receiving) {
					try {
						Object obj = in.readObject();
						
						if (obj == null) {
							return;
						}
						
						if(!(obj instanceof IPacket)) {
							log.err("A class was received, but is not a packet!");
							continue;
						}
						
						IPacket packet = (IPacket)obj;
						
						if(packet.check()) {
							notfiyReceive(packet);
							receivedPackets.add(packet);
							
							notifyNewPackageInList();
						}else{
							log.err("Packet contained invalid data!");
						}
						
						
					} catch (ClassNotFoundException e) {
						log.warn("Failed to read incomming packet!");
						log.excp(e);
					}
				}
			} catch(IOException e) {
				log.excp(e);
				if(connected) {
					notfiyError(e);
				}
				
			} finally {
				close();
			}
		}