Annotation of libwww/Library/src/HTNetMan.html, revision 2.26

2.1       frystyk     1: <HTML>
                      2: <HEAD>
2.23      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
2.23      frystyk    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.23      frystyk    21: part of the <A HREF="http://www.w3.org/Library/">W3C Sample Code Library</A>.
2.1       frystyk    22: <PRE>
                     23: #ifndef HTNETMAN_H
                     24: #define HTNETMAN_H
                     25: #include "HTNet.h"
                     26: #include "HTDNS.h"
2.14      eric       27: #include "HTEvent.h"
2.13      frystyk    28: #include "HTProt.h"
2.26    ! vbancrof   29: 
        !            30: #ifdef __cplusplus
        !            31: extern "C" { 
        !            32: #endif 
2.1       frystyk    33: </PRE>
2.14      eric       34: <P>
                     35: The <CODE>HTNet</CODE> object is the core of the request queue management.
                     36: This object contains information about the socket descriptor, the input read
                     37: buffer etc. required to identify and service a request.
2.1       frystyk    38: <PRE>
                     39: struct _HTNet {
2.17      frystyk    40:     int                 hash;                                  /* Hash value */
                     41: 
2.13      frystyk    42:     /* Link to other objects */
                     43:     HTRequest *                request;                   /* Link to request object */
2.18      frystyk    44:     HTHost *           host;          /* What we know about the remote host */
2.13      frystyk    45:     HTProtocol *       protocol;                /* Protocol to this request */
                     46:     HTTransport *      transport;             /* Transport for this request */
2.18      frystyk    47:     int                 session;
2.12      frystyk    48: 
2.13      frystyk    49:     /* For progress notifications */
2.25      frystyk    50:     BOOL               countRawBytes;       /* If we should count raw bytes */
2.18      frystyk    51:     long               bytesRead;                          /* Bytes in body */
2.23      frystyk    52:     long               headerBytesRead;             /* Bytes read in header */
2.18      frystyk    53:     long               bytesWritten;            /* Bytes written to network */
2.23      frystyk    54:     long               headerBytesWritten;       /* Bytes written in header */
2.12      frystyk    55: 
2.20      frystyk    56: #if 0
2.1       frystyk    57:     int                        retry;               /* Counting attempts to connect */
                     58:     int                home;                    /* Current home if multiple */
2.20      frystyk    59: #endif
                     60: 
2.1       frystyk    61:     time_t             connecttime;             /* Used on multihomed hosts */
2.18      frystyk    62:     BOOL               preemptive;  /* Eff result from Request and Protocol */
                     63: 
                     64:     HTEvent            event;
                     65:     HTStream *         readStream;    /* host's input stream puts data here */
2.13      frystyk    66: 
                     67:     /* User specific stuff */
2.1       frystyk    68:     void *             context;                /* Protocol Specific context */
2.18      frystyk    69: 
                     70:     /* Eric's sleezoid cheat - should go to extra pipeline object */
2.19      frystyk    71:     HTEventType                registeredFor;
2.1       frystyk    72: };
                     73: 
2.18      frystyk    74: extern SOCKET HTNet_socket(HTNet * me);
2.7       frystyk    75: 
2.23      frystyk    76: </PRE>
                     77: <H2>
                     78:   Bytes Read Stats
                     79: </H2>
                     80: <H3>
                     81:   Total Bytes Read
                     82: </H3>
                     83: <PRE>
                     84: #define HTNet_setBytesRead(me,l)         ((me) ? (me-&gt;bytesRead=(l)) : -1)
                     85: #define HTNet_bytesRead(me)              ((me) ? (me)-&gt;bytesRead : -1)
                     86: #define HTNet_addBytesRead(me,l)          ((me) ? (me-&gt;bytesRead+=(l)) : -1)
                     87: </PRE>
                     88: <H3>
                     89:   Header Bytes Read
                     90: </H3>
                     91: <PRE>
                     92: #define HTNet_setHeaderBytesRead(me,l)   ((me) ? (me-&gt;headerBytesRead=(l)) :-1)
                     93: #define HTNet_headerBytesRead(me)        ((me) ? (me)-&gt;headerBytesRead : -1)
                     94: #define HTNet_addHeaderBytesRead(me,l)    ((me) ? (me-&gt;headerBytesRead+=(l)) : -1)
                     95: </PRE>
                     96: <H2>
                     97:   Bytes Written Stats
                     98: </H2>
                     99: <H3>
                    100:   Total Bytes Written
                    101: </H3>
                    102: <PRE>
                    103: #define HTNet_setBytesWritten(me,l)      ((me) ? (me-&gt;bytesWritten=(l)) :-1)
                    104: #define HTNet_bytesWritten(me)           ((me) ? (me)-&gt;bytesWritten : -1)
                    105: #define HTNet_addBytesWritten(me,l)       ((me) ? (me-&gt;bytesWritten+=(l)) : -1)
                    106: </PRE>
                    107: <H3>
                    108:   Header Bytes Written
                    109: </H3>
                    110: <PRE>
                    111: #define HTNet_setHeaderBytesWritten(me,l) ((me) ? (me-&gt;headerBytesWritten=(l)) :-1)
2.24      frystyk   112: #define HTNet_headerBytesWritten(me)  ((me) ? \
                    113:                                        ((me)-&gt;headerBytesWritten==0 ? \
                    114:                                         HTNet_bytesWritten(me) : \
                    115:                                         (me)-&gt;headerBytesWritten) : -1)
2.23      frystyk   116: #define HTNet_addHeaderBytesWritten(me,l) ((me) ? (me-&gt;headerBytesWritten+=(l)) : -1)
                    117: </PRE>
                    118: <H2>
                    119:   Event Callbacks
                    120: </H2>
                    121: <PRE>
2.18      frystyk   122: extern BOOL HTNet_setEventParam(HTNet * net, void * eventParam);
                    123: extern void* HTNet_eventParam(HTNet * net);
                    124: extern BOOL HTNet_setEventCallback(HTNet * net, HTEventCallback * cbf);
                    125: extern HTEventCallback * HTNet_eventCallback(HTNet * net);
                    126: extern BOOL HTNet_setEventPriority(HTNet * net, HTPriority priority);
                    127: extern HTPriority HTNet_eventPriority(HTNet * net);
2.1       frystyk   128: </PRE>
                    129: <PRE>
2.26    ! vbancrof  130: #ifdef __cplusplus
        !           131: }
        !           132: #endif
        !           133: 
2.1       frystyk   134: #endif /* HTNETMAN_H */
                    135: </PRE>
2.14      eric      136: <P>
                    137:   <HR>
2.13      frystyk   138: <ADDRESS>
2.26    ! vbancrof  139:   @(#) $Id: HTNetMan.html,v 2.25 1998/09/24 19:48:52 frystyk Exp $
2.13      frystyk   140: </ADDRESS>
2.14      eric      141: </BODY></HTML>

Webmaster