File:
[Public] /
libwww /
Library /
src /
HTMuxCh.html
Revision
2.5:
download - view:
text,
annotated -
select for diffs
Fri Aug 4 10:37:51 2000 UTC (23 years, 10 months ago) by
kahan
Branches:
MAIN
CVS tags:
repeat-requests,
before_webdav,
Release-5-4-0,
Release-5-3-1,
HEAD,
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
JK: fixed a typo
<HTML>
<HEAD>
<TITLE>W3C Sample Code Library libwww MUX Protocol</TITLE>
</HEAD>
<BODY>
<H1>
The MUX Protocol
</H1>
<PRE>
/*
** (c) COPYRIGHT MIT 1995.
** Please first read the full copyright statement in the file COPYRIGH.
*/
</PRE>
<P>
This module defines the read and write functions to and from the network.
As we are having reentrant function and a smarter network I/O this will get
very small :-)
<P>
This module is implemented by <A HREF="HTMux.c">HTMux.c</A>, and it is a
part of the <A HREF="http://www.w3.org/Library/"> W3C Sample Code
Library</A>.
<PRE>
#ifndef HTMUXCHANNEL_H
#define HTMUXCHANNEL_H
typedef struct _HTMuxChannel HTMuxChannel;
typedef struct _HTMuxSession HTMuxSession;
typedef struct _HTMuxProtocol HTMuxProtocol;
typedef unsigned char HTMuxSessionId;
#include "HTMuxHeader.h"
#include "HTChannl.h"
#include "HTHost.h"
#define INVSID 0 /* Invalid session id */
#define INVPID 0 /* Invalid protocol id */
</PRE>
<H2>
Mux Channel
</H2>
<PRE>
extern HTMuxChannel * HTMuxChannel_new (HTHost * host);
extern HTMuxChannel * HTMuxChannel_find (HTHost * host);
extern BOOL HTMuxChannel_delete (HTMuxChannel * me);
extern BOOL HTMuxChannel_deleteAll (void);
extern HTNet * HTMuxChannel_net (HTMuxChannel * me);
extern HTMuxSession * HTMuxChannel_findSession (HTMuxChannel * me, HTMuxSessionId sid);
extern HTMuxSession * HTMuxChannel_findSessionFromNet (HTMuxChannel * me,
HTNet * net);
extern HTHost * HTMuxChannel_host (HTMuxChannel * muxch);
extern int HTMuxChannel_sendControl (HTMuxChannel * muxch, HTMuxSessionId sid,
HTMuxHeader opcode, int value,
const void * param, int param_size);
</PRE>
<H2>
Mux Session
</H2>
<PRE>
typedef enum _HTMuxClose {
MUX_S_END_READ = 0x1,
MUX_S_END_WRITE = 0x2,
MUX_S_END = 0x3
} HTMuxClose;
extern HTMuxSessionId HTMuxSession_accept (HTMuxChannel * muxch, HTNet * net,
HTProtocolId pid);
extern HTMuxSessionId HTMuxSession_connect (HTMuxChannel * muxch, HTNet * net,
HTProtocolId pid);
extern int HTMuxSession_close (HTMuxChannel * muxch, HTMuxSessionId sid);
extern HTMuxSession * HTMuxSession_register (HTMuxChannel * muxch,
HTMuxSessionId sid,
HTProtocolId pid);
extern HTMuxSessionId HTMuxSession_id (HTMuxSession * session);
extern HTProtocolId HTMuxSession_pid (HTMuxSession * session);
extern HTNet * HTMuxSession_net (HTMuxSession * session);
extern BOOL HTMuxSession_setClose (HTMuxChannel * muxch,
HTMuxSession * session, HTMuxClose close);
extern int HTMuxSession_credit (HTMuxSession * session);
extern BOOL HTMuxSession_setCredit (HTMuxChannel * muxch,
HTMuxSessionId sid, int credit);
extern int HTMuxSession_fragment (HTMuxSession * session);
extern BOOL HTMuxSession_setFragment (HTMuxChannel * muxch,
HTMuxSessionId sid, int fragment);
extern int HTMuxSession_disposeData (HTMuxSession * me,
const char * buf, int len);
</PRE>
<H2>
Mux Protocol
</H2>
<PRE>
extern BOOL HTMuxProtocol_add (HTMuxChannel * muxch,
HTProtocolId pid, const char * protocol);
extern BOOL HTMuxProtocol_delete (HTMuxChannel * muxch, HTProtocolId pid);
</PRE>
<PRE>
#endif
</PRE>
<P>
<HR>
<ADDRESS>
@(#) $Id: HTMuxCh.html,v 2.5 2000/08/04 10:37:51 kahan Exp $
</ADDRESS>
</BODY></HTML>
Webmaster