Annotation of libwww/Library/src/HTSocket.html, revision 2.20
2.1 frystyk 1: <HTML>
2: <HEAD>
2.18 frystyk 3: <TITLE>W3C Reference Library libwww Socket Interface</TITLE>
2.20 ! frystyk 4: <!-- Changed by: Henrik Frystyk Nielsen, 5-Apr-1996 -->
2.1 frystyk 5: <NEXTID N="z18">
6: </HEAD>
7: <BODY>
8:
9: <H1>Manages Read and Write to and from the Network</H1>
10:
11: <PRE>
12: /*
13: ** (c) COPYRIGHT MIT 1995.
14: ** Please first read the full copyright statement in the file COPYRIGH.
15: */
16: </PRE>
17:
18: This module defines the read and write functions to and from the
19: network. As we are having reentrant function and a smarter network I/O
20: this will get very small :-) <P>
21:
22: This module is implemented by <A HREF="HTSocket.c">HTSocket.c</A>, and
2.9 frystyk 23: it is a part of the <A HREF="http://www.w3.org/pub/WWW/Library/"> W3C
24: Reference Library</A>.
2.1 frystyk 25:
26: <PRE>
27: #ifndef HTSOCKET_H
28: #define HTSOCKET_H
29:
2.20 ! frystyk 30: #include <A HREF="HTReq.html">"HTEvntrg.h"</A>
2.1 frystyk 31: </PRE>
32:
2.20 ! frystyk 33: <H2>Reading CRLF</H2>
2.1 frystyk 34:
2.18 frystyk 35: The Library provides a default set of read routines that can handle
36: the most common situations. However, before we start we make following
37: definition is to make life easier when having a state machine looking
38: for a <CODE><CRLF></CODE> sequence.
2.1 frystyk 39:
40: <PRE>
2.18 frystyk 41: typedef enum _HTEOLState {
2.1 frystyk 42: EOL_ERR = -1,
43: EOL_BEGIN = 0,
44: EOL_FCR,
45: EOL_FLF,
46: EOL_DOT,
47: EOL_SCR,
48: EOL_SLF
2.18 frystyk 49: } HTEOLState;
50: </PRE>
51:
52: <H2>Load Data from a Socket</H2>
2.2 frystyk 53:
2.18 frystyk 54: This function is a wrapper around the <CODE>HTSocketRead()</CODE>
55: declared below. It provides a callback function for the <A
56: HREF="HTEvntrg.html">event loop</A> so that a socket can be loaded
57: using non-blocking I/O. The function requires an <B>open</B>
58: socket. It will typically be used in server applications or in a
59: client application that can read directly from <CODE>stdin</CODE>.
2.2 frystyk 60:
61: <PRE>
2.18 frystyk 62: extern HTEventCallback HTLoadSocket;
2.9 frystyk 63: </PRE>
2.1 frystyk 64:
2.9 frystyk 65: <PRE>
2.1 frystyk 66: #endif
67: </PRE>
68:
2.20 ! frystyk 69: <HR>
! 70: <ADDRESS>
! 71: @(#) $Id: Date Author State $
! 72: </ADDRESS>
2.1 frystyk 73: </BODY>
74: </HTML>
Webmaster