void io_flush(int flush_type)
{
	if (iobuf.out.len > iobuf.out_empty_len) {
		if (flush_type == FULL_FLUSH)		/* flush everything in the output buffers */
			perform_io(iobuf.out.size - iobuf.out_empty_len, PIO_NEED_OUTROOM);
		else if (flush_type == NORMAL_FLUSH)	/* flush at least 1 byte */
			perform_io(iobuf.out.size - iobuf.out.len + 1, PIO_NEED_OUTROOM);
							/* MSG_FLUSH: flush iobuf.msg only */
	}
	if (iobuf.msg.len)
		perform_io(iobuf.msg.size, PIO_NEED_MSGROOM);
}
void io_flush(int flush_type)
{
	if (iobuf.out.len > iobuf.out_empty_len) {
		if (flush_type == FULL_FLUSH)		 
			perform_io(iobuf.out.size - iobuf.out_empty_len, PIO_NEED_OUTROOM);
		else if (flush_type == NORMAL_FLUSH)	 
			perform_io(iobuf.out.size - iobuf.out.len + 1, PIO_NEED_OUTROOM);
							 
	}
	if (iobuf.msg.len)
		perform_io(iobuf.msg.size, PIO_NEED_MSGROOM);
}