WriteClient - sends data to the client in ISAPI
/* cb is either an extension control block or a filter context; see isapi(7). */ HCONN connid = (extension) ? cb->ConnID : cb; char buffer[SIZE]; DWORD bufsiz = SIZE; DWORD mode = (extension) ? HSE_IO_SYNC /* or HSE_IO_ASYNC */ : 0; /* ... fill buffer with data ... */ if ((*(cb->WriteClient))( connid, (void *)buffer, &bufsiz, mode )) { /* bufsiz updated, if synchronous */ } else { /* handle failure */ }
WriteClient sends data back to the client; it will attempt to read bufsiz bytes from the given buffer and send them on the socket on which the client (identified by the connection identifier, connid) is connected.
First parameter is a connection identifier; for the WriteClient of an extension control block, this is the ConnID field of the block; for the WriteClient of a filter context, this is the filter context itself.
Second argument, buffer, is the address of the start of the data to be written; third argument, &bufsiz, is a pointer to an integer variable whose value, when WriteClient is called, is the number of bytes of data to read from that address and send to the client.
The fourth argument is a control flag. A filter should pass 0 for this flag. An extension can use it to specify whether the data is to be written synchronously using HSE_IO_SYNC, in which case, on success, the data will be written before WriteClient returns and bufsiz will be updated to the number of bytes written - or asynchronously using HSE_IO_ASYNC, in which case the extension must have made a call to ServerSupportFunction with request HSE_REQ_IO_COMPLETION (and appropriate further data) to register a callback by which the ISAPI runner can notify the extension library that the write has completed. Currently, only HSE_IO_SYNC is supported.
Returns TRUE on success; FALSE otherwise.
In the asynchronous case, note that a TRUE return only means that the write has been successfully initiated; whether the write succeeds will not be known until the associated I/O callback is called.
isapi(7),
HttpExtensionProc(3),
HttpFilterProc(3),
EXTENSION_CONTROL_BLOCK(5),
HTTP_FILTER_CONTEXT(5).
$ZEUSHOME/web/include/httpext.h $ZEUSHOME/web/include/httpfilt.h $ZEUSHOME/web/include/wintypes.h $ZEUSHOME/webadmin/docroot/docs/modules/isapi/*.html
Copyright (C) 2000-2001 Zeus Technology Limited. All rights reserved.