public void run() {
		logger.finer("Receiving packets...");
		isReceiving = true;
		while(isReceiving) {
			byte[] bytes = new byte[Packet.MAXIMUM_PACKET_SIZE];
			DatagramPacket datagramPacket = new DatagramPacket(bytes, bytes.length);
			try {
				socket.receive(datagramPacket);
				try {
					Packet packet = Packet.parsePacket(datagramPacket.getData(), datagramPacket.getLength());
					logger.finest("Received packet");
					receiver.receivePacket(packet, datagramPacket.getAddress().getHostAddress(), datagramPacket.getPort());
				} catch (MalformedPacketException e) {
					//it might be valuable to inform the server that it's receiving invalid packets from a client
					receiver.receivePacket(null, datagramPacket.getAddress().getHostAddress(), datagramPacket.getPort());
				}
			} catch (IOException e) {
				//if the packet is having trouble receiving, the best thing to
				// do is keep trying. If the problem persists the connection
				// will time out
				if(logger.isLoggable(Level.FINEST))
					logger.finest("IOException while receiving packets: " + e.getMessage());
			}
		}
	}