private void drainOutput() {
		try {
			LOGGER.debug("Draining Output");
			if ((readyOps & SelectionKey.OP_WRITE) != 0) {
				Message msg;
				while ((msg = outQueue.poll()) != null) {
					LOGGER.debug("Sending message " + msg.toString());
					ByteBuffer buffer = msg.toByteBuffer();
					channel.write(buffer);
				}
				if (outQueue.isEmpty()) {
					disableWriteSelection();
					if (shutingdown) {
						channel.close();
					}
				}
			}
		} catch (IOException e) {
			LOGGER.warn("remote client ended connection");
			this.kill();
		}
	}