From c2453002d3d970a4ed203df39dd460b21687f2db Mon Sep 17 00:00:00 2001 From: leitner Date: Mon, 8 Sep 2003 21:05:27 +0000 Subject: [PATCH] add small explanation to iob.h --- CHANGES | 1 + GNUmakefile | 3 +++ iob.h | 11 +++++++++++ 3 files changed, 15 insertions(+) diff --git a/CHANGES b/CHANGES index 62564bb..9aeed8b 100644 --- a/CHANGES +++ b/CHANGES @@ -8,6 +8,7 @@ add buffer functions to write strerror(errno) add io API supporting poll, epoll and kqueue remove obsolete "extern" from header files + add iob API to send several buffers and files in one batch 0.15: man page update (document stralloc return values) diff --git a/GNUmakefile b/GNUmakefile index 8b54f64..5f7cc6f 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -62,6 +62,9 @@ $(ARRAY_OBJS): uint64.h array.h $(MULT_OBJS): uint64.h uint32.h uint16.h safemult.h $(IO_OBJS): uint64.h array.h io.h io_internal.h taia.h tai.h haveepoll.h havekqueue.h + +iob_addbuf.o iob_addfile.o iob_new.o iob_reset.o iob_send.o: iob_internal.h iob.h + iopause.o: select.h openreadclose.o readclose.o: readclose.h dns_rcip.o dns_rcrw.o openreadclose.o: openreadclose.h diff --git a/iob.h b/iob.h index d0a49b8..7318f84 100644 --- a/iob.h +++ b/iob.h @@ -1,6 +1,17 @@ #ifndef _IOB_H #define _IOB_H +/* These functions can be used to create a queue of small (or large) + * buffers and parts of files to be sent out over a socket. It is meant + * for writing HTTP servers or the like. */ + +/* This API works with non-blocking I/O. Simply call iob_send until it + * returns 0 (or -1). The implementation uses sendfile for zero-copy + * TCP and it will employ writev (or the built-in sendfile writev on + * BSD) to make sure the output fragments are coalesced into as few TCP + * frames as possible. On Linux it will also use the TCP_CORK socket + * option. */ + #include "io.h" typedef struct io_batch io_batch;