*/
	public int unusedOldWrite(ByteBuffer b) throws IOException {				
		int remain = b.remaining();
		int i = 0;
		while(b.hasRemaining()) {
			i++;
			int result = channel.write(b);
			
			//TODO: my performance tests showed when in lightweight apps, the performance of
			//this channelmanager is so good, it floods the nic's outgoing buffer and can't 
			//write to it....This sleep allows it to clean out it's buffer but should really 
			//be a register for write so the selector can notify us when we can write again....
			if(i > 5) {
				log.warning(this+"Having trouble writing data out.  result="+result+" b="+b);
				try {
					Thread.sleep(50*i); //this is a backoff, so it keeps backing off more and more until 500 ms
				} catch (InterruptedException e) {
					log.log(Level.WARNING, this+"exception", e);
				}
			} else if(i > 10) 
				throw new RuntimeException(this+"Bug, tried to write 1000 times and could not");
		}
		assert b.remaining() == 0 : this+"Did not write out all bytes";

		return remain;
	}