// open a connection with the server, at which point it should be safe to continue
// (since the extension shouldn't accept connections until it is ready for requests).
long waitUntil = System.currentTimeMillis() + connectTimeout;
while (!isConnected()) {
if (waitUntil < System.currentTimeMillis()) {
throw new NotConnectedException(
delegate.getAddressOfRemoteServer(), connectTimeout);
}
try {
Thread.sleep(100);