Annotation of libwww/Library/src/HTBufWrt.html, revision 2.7
2.1 frystyk 1: <HTML>
2: <HEAD>
2.2 frystyk 3: <!-- Changed by: Henrik Frystyk Nielsen, 13-Apr-1996 -->
4: <NEXTID N="z18">
2.4 frystyk 5: <TITLE>W3C Sample Code Library libwww Buffered Socket Writer Stream</TITLE>
2.1 frystyk 6: </HEAD>
7: <BODY>
2.2 frystyk 8: <H1>
9: Buffered Socket Writer Stream
10: </H1>
2.1 frystyk 11: <PRE>
12: /*
13: ** (c) COPYRIGHT MIT 1995.
14: ** Please first read the full copyright statement in the file COPYRIGH.
15: */
16: </PRE>
2.2 frystyk 17: <P>
18: The Buffered Socket Writer Stream is an <A HREF="HTIOStream.html">output
19: stream </A> which knows how to write to a BSD type socket. It is part
20: of the <A HREF="WWWTrans.html">Transport interface </A>and may be registered
21: as part of a <A HREF="HTTrans.html">Transport Object</A>. The application
22: can initialize this stream together with the
23: <A HREF="HTReader.html">HTReader stream</A>, for example. In the
24: <A HREF="HTInit.html">default initialization module</A>, you can find the
25: <CODE>HTTransportInit()</CODE> function which sets up this stream as a default
26: transport for handling unbuffered socket write operations.
27: <P>
28: The difference from the <A HREF="HTWriter.html">unbuffered write stream</A>
29: is that this stream lets you write characters without causing a
30: <CODE>write</CODE> system call every time. The data is first written into
31: a buffer. Data is written to the transport only when the buffer is full,
32: or when the stream is flushed.
33: <P>
34: This module is implemented by <A HREF="HTBufWrt.c">HTBufWrt.c</A>, and it
2.5 frystyk 35: is a part of the <A HREF="http://www.w3.org/Library/">W3C Sample Code
2.2 frystyk 36: Library</A>.
2.1 frystyk 37: <PRE>
38: #ifndef HTBUFWRT_H
39: #define HTBUFWRT_H
40:
41: #include <A HREF="HTIOStream.html">"HTIOStream.h"</A>
2.7 ! vbancrof 42:
! 43: #ifdef __cplusplus
! 44: extern "C" {
! 45: #endif
2.1 frystyk 46: </PRE>
2.2 frystyk 47: <H2>
48: Default Output Buffering
49: </H2>
50: <P>
51: In order to optimize reading a channel, we bind a buffer to each channel
52: object. The size of this buffer is a compromise between speed and memory.
53: By default, we have chosen a value frequently used in TCP connections. In
54: the stream creation method you can pass any other buffer size. In the case
55: of 0, we take the default size.
2.1 frystyk 56: <PRE>
2.3 frystyk 57: #define OUTPUT_BUFFER_SIZE 1024
2.1 frystyk 58: </PRE>
2.2 frystyk 59: <H2>
60: Buffered Write Stream
61: </H2>
2.1 frystyk 62: <PRE>
63: extern HTOutput_new HTBufferWriter_new;
64: </PRE>
2.6 frystyk 65: <H2>
66: Buffered Write Converter Stream
67: </H2>
68: <PRE>
69: extern HTOutputConverter_new HTBufferConverter_new;
70: </PRE>
2.1 frystyk 71: <PRE>
2.7 ! vbancrof 72: #ifdef __cplusplus
! 73: }
2.1 frystyk 74: #endif
2.7 ! vbancrof 75:
! 76: #endif /* HTBUFWRT_H */
2.1 frystyk 77: </PRE>
78: <P>
2.2 frystyk 79: <HR>
2.1 frystyk 80: <ADDRESS>
2.7 ! vbancrof 81: @(#) $Id: HTBufWrt.html,v 2.6 1999/04/04 00:12:00 frystyk Exp $
2.1 frystyk 82: </ADDRESS>
2.2 frystyk 83: </BODY></HTML>
Webmaster