Annotation of libwww/Library/src/HTNetMan.html, revision 2.22
2.1 frystyk 1: <HTML>
2: <HEAD>
2.16 frystyk 3: <!-- Changed by: Henrik Frystyk Nielsen, 19-May-1996 -->
2.21 frystyk 4: <TITLE>W3C Sample Code Library libwww Private Net Definition</TITLE>
2.1 frystyk 5: </HEAD>
6: <BODY>
2.14 eric 7: <H1>
2.16 frystyk 8: Private Net Definition
2.14 eric 9: </H1>
2.1 frystyk 10: <PRE>
11: /*
12: ** (c) COPYRIGHT MIT 1995.
13: ** Please first read the full copyright statement in the file COPYRIGH.
14: */
15: </PRE>
2.14 eric 16: <P>
2.16 frystyk 17: This is the private definition of the Net Class. Please look in the public
18: <A HREF="HTNet.html">Net Class</A> for more documentation
2.14 eric 19: <P>
20: This module is implemented by <A HREF="HTNet.c">HTNet.c</A>, and it is a
2.22 ! frystyk 21: part of the <A HREF="http://www.w3.org/Library/">W3C Sample Code
2.14 eric 22: Library</A>.
2.1 frystyk 23: <PRE>
24: #ifndef HTNETMAN_H
25: #define HTNETMAN_H
26: #include "HTNet.h"
27: #include "HTDNS.h"
2.14 eric 28: #include "HTEvent.h"
2.13 frystyk 29: #include "HTProt.h"
2.1 frystyk 30: </PRE>
2.14 eric 31: <P>
32: The <CODE>HTNet</CODE> object is the core of the request queue management.
33: This object contains information about the socket descriptor, the input read
34: buffer etc. required to identify and service a request.
2.1 frystyk 35: <PRE>
36: struct _HTNet {
2.17 frystyk 37: int hash; /* Hash value */
38:
2.13 frystyk 39: /* Link to other objects */
40: HTRequest * request; /* Link to request object */
2.18 frystyk 41: HTHost * host; /* What we know about the remote host */
2.13 frystyk 42: HTProtocol * protocol; /* Protocol to this request */
43: HTTransport * transport; /* Transport for this request */
2.18 frystyk 44: int session;
2.12 frystyk 45:
2.13 frystyk 46: /* For progress notifications */
2.18 frystyk 47: long bytesRead; /* Bytes in body */
48: long headerLength; /* Bytes read in header */
49: long bytesWritten; /* Bytes written to network */
2.12 frystyk 50:
2.20 frystyk 51: #if 0
2.1 frystyk 52: int retry; /* Counting attempts to connect */
53: int home; /* Current home if multiple */
2.20 frystyk 54: #endif
55:
2.1 frystyk 56: time_t connecttime; /* Used on multihomed hosts */
2.18 frystyk 57: BOOL preemptive; /* Eff result from Request and Protocol */
58:
59: HTEvent event;
60: HTStream * readStream; /* host's input stream puts data here */
2.13 frystyk 61:
62: /* User specific stuff */
2.1 frystyk 63: void * context; /* Protocol Specific context */
2.18 frystyk 64:
65: /* Eric's sleezoid cheat - should go to extra pipeline object */
2.19 frystyk 66: HTEventType registeredFor;
2.1 frystyk 67: };
68:
2.18 frystyk 69: extern SOCKET HTNet_socket(HTNet * me);
2.7 frystyk 70:
2.18 frystyk 71: #define HTNet_setBytesRead(me,l) ((me) ? (me->bytesRead=(l)) : -1)
72: #define HTNet_setBytesWritten(me,l) ((me) ? (me->bytesWritten=(l)) :-1)
73: #define HTNet_setHeaderLength(me,l) ((me) ? (me->headerLength=(l)) :-1)
74:
75: #define HTNet_bytesRead(me) ((me) ? (me)->bytesRead : -1)
76: #define HTNet_bytesWritten(me) ((me) ? (me)->bytesWritten : -1)
77: #define HTNet_headerLength(me) ((me) ? (me)->headerLength : -1)
78:
79: #define HTNet_addBytesRead(me,l) ((me) ? (me->bytesRead+=(l)) : -1)
80: #define HTNet_addBytesWritten(me,l) ((me) ? (me->bytesWritten+=(l)) : -1)
81: #define HTNet_addHeaderLength(me,l) ((me) ? (me->headerLength+=(l)) : -1)
82:
83: extern BOOL HTNet_setEventParam(HTNet * net, void * eventParam);
84: extern void* HTNet_eventParam(HTNet * net);
85: extern BOOL HTNet_setEventCallback(HTNet * net, HTEventCallback * cbf);
86: extern HTEventCallback * HTNet_eventCallback(HTNet * net);
87: extern BOOL HTNet_setEventPriority(HTNet * net, HTPriority priority);
88: extern HTPriority HTNet_eventPriority(HTNet * net);
2.1 frystyk 89: </PRE>
90: <PRE>
91: #endif /* HTNETMAN_H */
92: </PRE>
2.14 eric 93: <P>
94: <HR>
2.13 frystyk 95: <ADDRESS>
2.22 ! frystyk 96: @(#) $Id: HTNetMan.html,v 2.21 1997/02/16 18:42:45 frystyk Exp $
2.13 frystyk 97: </ADDRESS>
2.14 eric 98: </BODY></HTML>
Webmaster