📄 httrans.h
字号:
/* W3C Sample Code Library libwww Transport Class! The Transport Class!*//*** (c) COPYRIGHT MIT 1995.** Please first read the full copyright statement in the file COPYRIGH.*//*The Transport Class defines a transport as used by theHTChannel class to communicate with the network,the local file system etc. New transport objects may be registered at anytime. This allows the application to easily hook in its own transport layers.The purpose of the HTTransport object is to contain transport dependent methodsfor opening and closing a connection to the transport and also to get aninput stream and an output strean for reading and writing to the transportrespectively.Note: The library core does not define any default transportobjects - they are all considered part of the application. The library comeswith a default set of transports which can be initiated using the functionHTTransportInit() in HTInit moduleThis module is implemented by HTTrans.c, and it isa part of the W3C Sample CodeLibrary.*/#ifndef HTTRANS_H#define HTTRANS_H/*. Creation and Deletion Methods.All transport interfaces are registered dynamically in libwww. This meansthat libwww is independent of the transport being used (for example TCP)and you can therefore use libwww in any context you like. You have to specifya set of parameters in order for libwww to be able to use it. The transportclass is defined as follows:*/typedef struct _HTTransport HTTransport;typedef enum _HTTransportMode { HT_TP_SINGLE = 0, /* One single request at a time */ HT_TP_PIPELINE = 1, /* Use pipelined requests */ HT_TP_INTERLEAVE = 2 /* Can we interleave requests? */} HTTransportMode;#include "HTIOStream.h"#include "HTReq.h"/*( Add a Transport)A new transport can be registered at any time in the Library. You must specifya name ad the supported channel mode that the transport supports. Then youmust also register two creation methods of an input and an output streamrespectively. You can find the definition of the I/O streams in theHTIOStream module.*/extern BOOL HTTransport_add (const char * name, HTTransportMode mode, HTInput_new * get_input, HTOutput_new * get_output);/*( Delete a Transport)This functions deletes a registered protocol module so that it can not beused for accessing a resource anymore.*/extern BOOL HTTransport_delete (const char * name);/*( Remove ALL Registered Transports)This is the garbage collection function. It is called byHTLibTerminate()*/extern BOOL HTTransport_deleteAll (void);/*. Transport Class Methods.( Find a Transport Protocol Object)You can search the list of registered protocol objects as a function of theaccess acheme. If an access scheme is found then the protocol object is returned.*/extern HTTransport * HTTransport_find (HTRequest * request, const char * name);/*( Supported Transort Modes)A transport object is registered with the flow controlmode that it supports. This mode describes whether we can issue multiplerequests at the same time.*/extern HTTransportMode HTTransport_mode (HTTransport * tp);extern BOOL HTTransport_setMode (HTTransport * tp, HTTransportMode mode);/*( Input and Output Stream Creation Methods)*/struct _HTTransport { char * name; HTTransportMode mode; /* Flow mode supported */ HTInput_new * input_new; /* Input stream creation method */ HTOutput_new * output_new; /* Output stream creation method */};/**/#endif /* HTTRANS_H *//* @(#) $Id: HTTrans.html,v 2.7 1998/05/14 02:11:14 frystyk Exp $*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -