public synchronized void waitForComplete() throws IOException, InterruptedException {
		if(!isFinished)
			this.wait(30000);
		if(!isFinished)
			throw new RuntimeException(channel+"Failed to finish for 10 seconds.  current="+Thread.currentThread()+" selector="+thread);
		
		if(e != null) {
			if(e instanceof IOException)
				throw (IOException)e;
			else if(e instanceof RuntimeException)
				throw (RuntimeException)e;
			else
				throw new RuntimeException(e);
		}	
	}