File:  [Public] / libwww / Library / src / HTNetMan.html
Revision 2.25: download - view: text, annotated - select for diffs
Thu Sep 24 19:48:52 1998 UTC (25 years, 8 months ago) by frystyk
Branches: MAIN
CVS tags: repeat-requests, before_webdav, Release-5-4-0, Release-5-3-1, Release-5-2-8, Release-5-2-6, Release-5-2, HEAD, Before-New-Trace-Messages, Amaya_2_4, Amaya-6-3, Amaya-6-1, Amaya-5-2, Amaya-4-3-2, Amaya-4-3-1, Amaya-4-3, Amaya-4-1-2, Amaya-4-1-0, Amaya-4-0-0, Amaya-3-2-1, Amaya-3-2, Amaya
Added support for interrupting and timing out FTP requests and added a mechanism for figuring out the length of a document fetched using FTP.

<HTML>
<HEAD>
  <!-- Changed by: Henrik Frystyk Nielsen, 19-May-1996 -->
  <TITLE>W3C Sample Code Library libwww Private Net Definition</TITLE>
</HEAD>
<BODY>
<H1>
  Private Net Definition
</H1>
<PRE>
/*
**	(c) COPYRIGHT MIT 1995.
**	Please first read the full copyright statement in the file COPYRIGH.
*/
</PRE>
<P>
This is the private definition of the Net Class. Please look in the public
<A HREF="HTNet.html">Net Class</A> for more documentation
<P>
This module is implemented by <A HREF="HTNet.c">HTNet.c</A>, and it is a
part of the <A HREF="http://www.w3.org/Library/">W3C Sample Code Library</A>.
<PRE>
#ifndef HTNETMAN_H
#define HTNETMAN_H
#include "HTNet.h"
#include "HTDNS.h"
#include "HTEvent.h"
#include "HTProt.h"
</PRE>
<P>
The <CODE>HTNet</CODE> object is the core of the request queue management.
This object contains information about the socket descriptor, the input read
buffer etc. required to identify and service a request.
<PRE>
struct _HTNet {
    int                 hash;                                  /* Hash value */

    /* Link to other objects */
    HTRequest *		request;		   /* Link to request object */
    HTHost *		host;	       /* What we know about the remote host */
    HTProtocol *	protocol;		 /* Protocol to this request */
    HTTransport *	transport;	       /* Transport for this request */
    int                 session;

    /* For progress notifications */
    BOOL		countRawBytes;	     /* If we should count raw bytes */
    long		bytesRead;			    /* Bytes in body */
    long		headerBytesRead;	     /* Bytes read in header */
    long		bytesWritten;		 /* Bytes written to network */
    long		headerBytesWritten;	  /* Bytes written in header */

#if 0
    int			retry;		     /* Counting attempts to connect */
    int 		home;			 /* Current home if multiple */
#endif

    time_t		connecttime;		 /* Used on multihomed hosts */
    BOOL		preemptive;  /* Eff result from Request and Protocol */

    HTEvent		event;
    HTStream *		readStream;    /* host's input stream puts data here */

    /* User specific stuff */
    void *		context;		/* Protocol Specific context */

    /* Eric's sleezoid cheat - should go to extra pipeline object */
    HTEventType		registeredFor;
};

extern SOCKET HTNet_socket(HTNet * me);

</PRE>
<H2>
  Bytes Read Stats
</H2>
<H3>
  Total Bytes Read
</H3>
<PRE>
#define HTNet_setBytesRead(me,l)	  ((me) ? (me-&gt;bytesRead=(l)) : -1)
#define HTNet_bytesRead(me)		  ((me) ? (me)-&gt;bytesRead : -1)
#define HTNet_addBytesRead(me,l)          ((me) ? (me-&gt;bytesRead+=(l)) : -1)
</PRE>
<H3>
  Header Bytes Read
</H3>
<PRE>
#define HTNet_setHeaderBytesRead(me,l)	  ((me) ? (me-&gt;headerBytesRead=(l)) :-1)
#define HTNet_headerBytesRead(me)	  ((me) ? (me)-&gt;headerBytesRead : -1)
#define HTNet_addHeaderBytesRead(me,l)    ((me) ? (me-&gt;headerBytesRead+=(l)) : -1)
</PRE>
<H2>
  Bytes Written Stats
</H2>
<H3>
  Total Bytes Written
</H3>
<PRE>
#define HTNet_setBytesWritten(me,l)	  ((me) ? (me-&gt;bytesWritten=(l)) :-1)
#define HTNet_bytesWritten(me)		  ((me) ? (me)-&gt;bytesWritten : -1)
#define HTNet_addBytesWritten(me,l)       ((me) ? (me-&gt;bytesWritten+=(l)) : -1)
</PRE>
<H3>
  Header Bytes Written
</H3>
<PRE>
#define HTNet_setHeaderBytesWritten(me,l) ((me) ? (me-&gt;headerBytesWritten=(l)) :-1)
#define HTNet_headerBytesWritten(me)  ((me) ? \
                                       ((me)-&gt;headerBytesWritten==0 ? \
                                        HTNet_bytesWritten(me) : \
                                        (me)-&gt;headerBytesWritten) : -1)
#define HTNet_addHeaderBytesWritten(me,l) ((me) ? (me-&gt;headerBytesWritten+=(l)) : -1)
</PRE>
<H2>
  Event Callbacks
</H2>
<PRE>
extern BOOL HTNet_setEventParam(HTNet * net, void * eventParam);
extern void* HTNet_eventParam(HTNet * net);
extern BOOL HTNet_setEventCallback(HTNet * net, HTEventCallback * cbf);
extern HTEventCallback * HTNet_eventCallback(HTNet * net);
extern BOOL HTNet_setEventPriority(HTNet * net, HTPriority priority);
extern HTPriority HTNet_eventPriority(HTNet * net);
</PRE>
<PRE>
#endif /* HTNETMAN_H */
</PRE>
<P>
  <HR>
<ADDRESS>
  @(#) $Id: HTNetMan.html,v 2.25 1998/09/24 19:48:52 frystyk Exp $
</ADDRESS>
</BODY></HTML>

Webmaster