/* ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH. */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 :-)
This module is implemented by HTSocket.c, and it is a part of the W3C Reference Library.
#ifndef HTSOCKET_H #define HTSOCKET_H #include "tcp.h" #include "HTReq.h" #include "HTStream.h" #include "HTAnchor.h" #include "HTEvntrg.h"
INPUT_BUFFER_SIZE
, is a compromise between speed and
memory. Here it is chosen as the default TCP High Water Mark
(sb_hiwat) for receiving data.
#define INPUT_BUFFER_SIZE 8192 typedef struct _HTInputSocket HTInputSocket; extern HTInputSocket* HTInputSocket_new (SOCKET file_number);
extern void HTInputSocket_free (HTInputSocket * isoc);
HTSocketRead()
declared below. It provides a callback function for the event loop so that a socket can be loaded
using non-blocking I/O. The function requires an open
socket. It will typically be used in server applications or in a
client application that can read directly from stdin
.
extern HTEventCallback HTLoadSocket;
<CRLF>
sequence.
typedef enum _HTSocketEOL { EOL_ERR = -1, EOL_BEGIN = 0, EOL_FCR, EOL_FLF, EOL_DOT, EOL_SCR, EOL_SLF } HTSocketEOL; extern FILE * HTSocket_DLLHackFopen (const char * filename, const char * mode); extern int HTSocketRead (HTRequest * request, HTNet * net);
extern int HTFileRead (HTRequest * request, HTNet * net, FILE * fp);
#endifEnd of declaration module