Annotation of libwww/Library/src/HTMuxCh.html, revision 2.6

2.1       frystyk     1: <HTML>
                      2: <HEAD>
2.2       frystyk     3:   <TITLE>W3C Sample Code Library libwww MUX Protocol</TITLE>
2.1       frystyk     4: </HEAD>
                      5: <BODY>
                      6: <H1>
                      7:   The MUX Protocol
                      8: </H1>
                      9: <PRE>
                     10: /*
                     11: **     (c) COPYRIGHT MIT 1995.
                     12: **     Please first read the full copyright statement in the file COPYRIGH.
                     13: */
                     14: </PRE>
                     15: <P>
                     16: This module defines the read and write functions to and from the network.
                     17: As we are having reentrant function and a smarter network I/O this will get
                     18: very small :-)
                     19: <P>
                     20: This module is implemented by <A HREF="HTMux.c">HTMux.c</A>, and it is a
2.3       frystyk    21: part of the <A HREF="http://www.w3.org/Library/"> W3C Sample Code
2.1       frystyk    22: Library</A>.
                     23: <PRE>
                     24: #ifndef HTMUXCHANNEL_H
                     25: #define HTMUXCHANNEL_H
                     26: 
2.6     ! vbancrof   27: #ifdef __cplusplus
        !            28: extern "C" { 
        !            29: #endif 
        !            30: 
2.1       frystyk    31: typedef struct _HTMuxChannel     HTMuxChannel;
                     32: typedef struct _HTMuxSession     HTMuxSession;
                     33: typedef struct _HTMuxProtocol    HTMuxProtocol;
                     34: 
                     35: typedef unsigned char            HTMuxSessionId;
                     36: 
2.6     ! vbancrof   37: #ifdef __cplusplus
        !            38: }
        !            39: #endif
        !            40: 
2.1       frystyk    41: #include "HTMuxHeader.h"
                     42: #include "HTChannl.h"
                     43: #include "HTHost.h"
                     44: 
2.6     ! vbancrof   45: #ifdef __cplusplus
        !            46: extern "C" { 
        !            47: #endif 
        !            48: 
2.1       frystyk    49: #define INVSID         0               /* Invalid session id */
                     50: #define INVPID          0               /* Invalid protocol id */
                     51: </PRE>
                     52: <H2>
                     53:   Mux Channel
                     54: </H2>
                     55: <PRE>
                     56: extern HTMuxChannel * HTMuxChannel_new (HTHost * host);
                     57: 
                     58: extern HTMuxChannel * HTMuxChannel_find (HTHost * host);
                     59: 
                     60: extern BOOL HTMuxChannel_delete (HTMuxChannel * me);
                     61: 
                     62: extern BOOL HTMuxChannel_deleteAll (void);
                     63: 
                     64: extern HTNet * HTMuxChannel_net (HTMuxChannel * me);
                     65: 
                     66: extern HTMuxSession * HTMuxChannel_findSession (HTMuxChannel * me, HTMuxSessionId sid);
                     67: 
                     68: extern HTMuxSession * HTMuxChannel_findSessionFromNet (HTMuxChannel * me,
                     69:                                                       HTNet * net);
                     70: 
                     71: extern HTHost * HTMuxChannel_host (HTMuxChannel * muxch);
                     72: 
                     73: extern int HTMuxChannel_sendControl (HTMuxChannel * muxch, HTMuxSessionId sid,
                     74:                                     HTMuxHeader opcode, int value,
                     75:                                     const void * param, int param_size);
                     76: 
                     77: </PRE>
                     78: <H2>
                     79:   Mux Session
                     80: </H2>
                     81: <PRE>
                     82: typedef enum _HTMuxClose {
                     83:     MUX_S_END_READ     = 0x1,
                     84:     MUX_S_END_WRITE    = 0x2,
                     85:     MUX_S_END          = 0x3
                     86: } HTMuxClose;
                     87: 
                     88: extern HTMuxSessionId HTMuxSession_accept (HTMuxChannel * muxch, HTNet * net,
                     89:                                           HTProtocolId pid);
                     90: 
                     91: extern HTMuxSessionId HTMuxSession_connect (HTMuxChannel * muxch, HTNet * net,
                     92:                                            HTProtocolId pid);
                     93: 
                     94: extern int HTMuxSession_close (HTMuxChannel * muxch, HTMuxSessionId sid);
                     95: 
                     96: extern HTMuxSession * HTMuxSession_register (HTMuxChannel * muxch,
                     97:                                             HTMuxSessionId sid,
                     98:                                              HTProtocolId pid);
                     99: 
                    100: extern HTMuxSessionId HTMuxSession_id (HTMuxSession * session);
                    101: 
                    102: extern HTProtocolId HTMuxSession_pid (HTMuxSession * session);
                    103: 
                    104: extern HTNet * HTMuxSession_net (HTMuxSession * session);
                    105: 
                    106: extern BOOL HTMuxSession_setClose (HTMuxChannel * muxch,
                    107:                                   HTMuxSession * session, HTMuxClose close);
                    108: 
                    109: extern int  HTMuxSession_credit (HTMuxSession * session);
                    110: 
                    111: extern BOOL HTMuxSession_setCredit (HTMuxChannel * muxch,
                    112:                                    HTMuxSessionId sid, int credit);
                    113: 
                    114: extern int  HTMuxSession_fragment (HTMuxSession * session);
                    115: 
                    116: extern BOOL HTMuxSession_setFragment (HTMuxChannel * muxch,
                    117:                                      HTMuxSessionId sid, int fragment);
2.4       kahan     118: 
2.5       kahan     119: extern int HTMuxSession_disposeData (HTMuxSession * me,
2.4       kahan     120:                                     const char * buf, int len);
2.1       frystyk   121: </PRE>
                    122: <H2>
                    123:   Mux Protocol
                    124: </H2>
                    125: <PRE>
                    126: extern BOOL HTMuxProtocol_add (HTMuxChannel * muxch,
                    127:                               HTProtocolId pid, const char * protocol);
                    128: 
                    129: extern BOOL HTMuxProtocol_delete (HTMuxChannel * muxch, HTProtocolId pid);
                    130: </PRE>
                    131: <PRE>
2.6     ! vbancrof  132: #ifdef __cplusplus
        !           133: }
2.1       frystyk   134: #endif
2.6     ! vbancrof  135: 
        !           136: #endif  /* HTMUXCHANNEL_H */
2.1       frystyk   137: </PRE>
                    138: <P>
                    139:   <HR>
                    140: <ADDRESS>
2.6     ! vbancrof  141:   @(#) $Id: HTMuxCh.html,v 2.5 2000/08/04 10:37:51 kahan Exp $
2.1       frystyk   142: </ADDRESS>
                    143: </BODY></HTML>

Webmaster