// pump events until timeout is reached
long timeoutTime = System.currentTimeMillis() + getRPCTimeout();
do {
sourceEventLoop.waitForIO(1);
} while (latch.getCount() == 1
|| System.currentTimeMillis() >= timeoutTime);
} else {
try {
latch.await(getRPCTimeout(), TimeUnit.MILLISECONDS);