Probably another two decades at most. China was undergoing unprecedented population growth and was becoming ever more reliant on Indian cotton imports. The great bottleneck was lack of knowledge of the market as no British merchants were able to go inland to meet with the end user. There were also no Chinese buyer in India to communicate with the producer. Unless the Emperor wants to see his citizens go naked, expanding trade was the only way. Even if the emperor refuse to grant foreigners access, the spike in cotton prices would behoove Chinese merchants to do business in India.
Also by the late 1830s, Britain had completed the first industrial revolution. This was a textile revolution and the results were not visibly impressive to the Chinese. However the second IR (steel, steam) was just beginning. It would be impossible to dismiss the foreigners as barbarians when they show up in steamships, which is what happened during Perry's embassy to Japan.