@Override
	public void run()
	{
		running=true;
		while(running)
		{
			try
			{
				in.read();
				while(!in.isEmpty())
				{
					byte messageid=in.readByte();
					handleMessages(in,messageid);
				}
			}
			catch(Exception ex)
			{
				ex.printStackTrace();
				running=false;
			}
		}
	}