private String getLocalAddress()
	{
		String localAddress = null;
		try
		{
			// loop through NetworkInterfaces
			Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();
			while (localAddress == null && networkInterfaces.hasMoreElements())
			{
				NetworkInterface netInterface = networkInterfaces.nextElement();
				Enumeration<InetAddress> inetAddresses = netInterface.getInetAddresses();
				
				// loop through inetAddresses in each NetworkInterface
				while (inetAddresses.hasMoreElements())
				{
					InetAddress inetAddress = inetAddresses.nextElement();
					String address = inetAddress.getHostAddress();
					
					// check first part of address against known local prefix
					if (address.length() > LOCAL_IDENTIFIER.length())
					{
						boolean isLocal = true;
						for (int i = 0; i < LOCAL_IDENTIFIER.length(); i++)
							if (address.charAt(i) != LOCAL_IDENTIFIER.charAt(i))
							{
								isLocal = false;
								break;
							}
						if (isLocal)
						{
							// local address found! leave
							localAddress = address;
							break;
						}
					}
				}
			}
		}
		catch (SocketException e)
		{
			e.printStackTrace();
		}
		
		// set stupid address if no local address was found
		if (localAddress == null)
			localAddress = "??";
		
		return localAddress;
	}