@Override
	public void run()
	{
		if(socket == null)
		{
			if(!setupMulticastservice())
			{
				System.err.println("Multicastservice not started.");
				return;
			}
		}
		
		running = true;		//set running flag
		try
		{
			while(running)
			{
				byte[] buffer = new byte[bufferSize];
				DatagramPacket messageIn = new DatagramPacket(buffer, buffer.length);
				socket.receive(messageIn);
				this.observer.setChanged();
				this.observer.notifyObservers(messageIn);
			}
		}
		catch(SocketException e)
		{
			System.out.println("Multicastsocket: " + e.getMessage());
		}
		catch(IOException e)
		{
			System.err.println("IO: " + e.getMessage());
		}
	}