private int oldWriteImpl(ByteBuffer b) throws IOException {
		if(!getSelectorManager().isRunning())
			throw new IllegalStateException(this+"ChannelManager must be running and is stopped");
		else if(isClosed) {
			AsynchronousCloseException exc = new AsynchronousCloseException();
			IOException ioe = new IOException(this+"Client cannot write after the client closed the socket");
			exc.initCause(ioe);
			throw exc;
		}
		Object t = getSelectorManager().getThread();
		if(Thread.currentThread().equals(t)) {
			//leave this in, users should not do this....
			throw new RuntimeException(this+"You should not perform a " +
					"blocking write on the channelmanager thread unless you like deadlock.  " +
					"Use the cm threading layer, or put the code calling this write on another thread");
		}

		try {
            int remain = b.remaining();

			UtilWaitForCompletion waitWrite = new UtilWaitForCompletion(this, t);
			oldWrite(b, waitWrite);
            //otherwise if not all was written, wait for completion as it was added to queue
            //which writes on selector thread....
			waitWrite.waitForComplete();
            
			if(b.hasRemaining())
				throw new RuntimeException(this+"Did not write all of the ByteBuffer out");
			return remain;
		} catch(InterruptedException e) {
			throw new RuntimeException(e);
		}
	}