Add synchronous functions waitForOpened and waitForClosed to the Proxy interface. Implement them in ProxyAdapter.