public void reconnect()
	{
		reconnecting = true;
		
		close();

		// Attempt reconnects every 5s
		while (!isConnected())
		{
			try
			{
				connect();
			}
			catch (IOException e)
			{
				System.err.println("Error when reconnecting: ");
				e.printStackTrace(); // For debug purposes

				sleep(5000);
			}
		}
		
		reconnecting = false;
	}