Annotation of libwww/Library/src/HTNetMan.html, revision 2.12
2.1 frystyk 1: <HTML>
2: <HEAD>
2.11 frystyk 3: <TITLE>W3C Reference Library libwww NET OBJECT</TITLE>
2.12 ! frystyk 4: <!-- Changed by: Henrik Frystyk Nielsen, 18-Mar-1996 -->
2.1 frystyk 5: </HEAD>
6: <BODY>
7:
8: <H1>Asyncronous Socket Management</H1>
9:
10: <PRE>
11: /*
12: ** (c) COPYRIGHT MIT 1995.
13: ** Please first read the full copyright statement in the file COPYRIGH.
14: */
15: </PRE>
16:
17: This module contains the routines for handling the set of active
18: sockets currently in use by the multithreaded clients. It is an
19: internal module to the Library, the application interface is
20: implemented in the <A HREF="HTEvntrg.html">Event Module</A>. Look for
21: more information in the <A
22: HREF="http://www.w3.org/pub/WWW/Library/User/Architecture/">
23: Multithread Specifications</A>. <P>
24:
25: This module is implemented by <A HREF="HTNet.c">HTNet.c</A>, and it is
26: a part of the <A HREF="http://www.w3.org/pub/WWW/Library/">W3C
27: Reference Library</A>.
28:
29: <PRE>
30: #ifndef HTNETMAN_H
31: #define HTNETMAN_H
32: #include "HTNet.h"
33: #include "HTDNS.h"
2.12 ! frystyk 34: #include "HTSocket.h"
2.1 frystyk 35: #include "HTEvntrg.h"
36: </PRE>
37:
38: <H2>The HTNet Object</H2>
39:
40: The <CODE>HTNet</CODE> object is the core of the request queue
41: management. This object contains information about the socket
42: descriptor, the input read buffer etc. required to identify and
43: service a request. <P>
44:
45: <PRE>
2.2 frystyk 46: typedef enum _TCPState {
47: TCP_ERROR = -2,
48: TCP_CONNECTED = -1,
49: TCP_BEGIN = 0,
50: TCP_DNS,
51: TCP_NEED_SOCKET,
2.3 frystyk 52: TCP_NEED_BIND,
53: TCP_NEED_LISTEN,
54: TCP_NEED_CONNECT
2.2 frystyk 55: } TCPState;
56:
2.1 frystyk 57: struct _HTNet {
2.5 frystyk 58: SOCKET sockfd; /* Socket descripter */
2.12 ! frystyk 59: SockA sock_addr; /* SockA is defined in sysdep.h */
! 60: HTPriority priority; /* Priority of this request (event) */
! 61:
! 62: HTStream * target; /* Target stream */
! 63: HTEventCallback * cbf; /* Protocol state machine */
! 64:
! 65: HTdns * dns; /* Link to DNS object */
! 66: HTRequest * request; /* Link to request object */
! 67:
! 68: long bytes_read; /* Bytes read from network */
! 69: long bytes_written; /* Bytes written to network */
! 70:
2.2 frystyk 71: TCPState tcpstate; /* State in connection */
2.1 frystyk 72: int retry; /* Counting attempts to connect */
73: int home; /* Current home if multiple */
74: time_t connecttime; /* Used on multihomed hosts */
2.7 frystyk 75: BOOL preemptive; /* Eff result from Request and Protocol */
2.9 frystyk 76: BOOL persistent; /* YES if persistent, otherwise NO */
2.1 frystyk 77: void * context; /* Protocol Specific context */
78: };
79:
2.7 frystyk 80: #define HTNet_bytesRead(me) ((me) ? (me)->bytes_read : -1)
81: #define HTNet_bytesWritten(me) ((me) ? (me)->bytes_written : -1)
82:
83: #define HTNet_setBytesRead(me,l) ((me) ? (me->bytes_read=(l)) : -1)
84: #define HTNet_setBytesWritten(me,l) ((me) ? (me->bytes_written=(l)) :-1)
85:
86: #define HTNet_dns(me) ((me) ? (me)->dns : NULL)
2.1 frystyk 87: </PRE>
88:
89: <PRE>
90: #endif /* HTNETMAN_H */
91: </PRE>
92:
93: End of declaration module
94: </BODY>
95: </HTML>
96:
97:
Webmaster